Part Number Hot Search : 
BZX84B ICS874 DL472 MIW1235 ZXTN19 20JL2C41 WHE1K0FE 42376
Product Description
Full Text Search
 

To Download MCP2515-IP Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? 2005 microchip technology inc. preliminary ds21801d-page 1 mcp2515 features ? implements can v2.0b at 1 mb/s: - 0 ? 8 byte length in the data field - standard and extended data and remote frames ? receive buffers, masks and filters: - two receive buffers with prioritized message storage - six 29-bit filters -two 29-bit masks ? data byte filtering on the first two data bytes (applies to standard data frames) ? three transmit buffers with prioritizaton and abort features ? high-speed spi? interface (10 mhz): - spi modes 0,0 and 1,1 ? one-shot mode ensures message transmission is attempted only one time ? clock out pin with programmable prescaler: - can be used as a clock source for other device(s) ? start-of-frame (sof) signal is available for monitoring the sof signal: - can be used for time-slot-based protocols and/or bus diagnostics to detect early bus degredation ? interrupt output pin with selectable enables ? buffer full output pins configurable as: - interrupt output for each receive buffer - general purpose output ? request-to-send (rts) input pins individually configurable as: - control pins to request transmission for each transmit buffer - general purpose inputs ? low-power cmos technology: - operates from 2.7v ? 5.5v - 5 ma active current (typical) - 1 a standby current (typical) (sleep mode) ? temperature ranges supported: - industrial (i): -40c to +85c - extended (e): -40c to +125c description microchip technology?s mcp2515 is a stand-alone controller area network (can) controller that imple- ments the can specification, version 2.0b. it is capable of transmitting and receiving both standard and extended data and remote frames. the mcp2515 has two acceptance masks and six acceptance filters that are used to filter out unwanted messages, thereby reducing the host mcus overhead. the mcp2515 interfaces with microcontrollers (mcus) via an industry standard serial peripheral interface (spi). package types txcan rxcan v dd reset cs so mcp2515 1 2 3 4 18 17 16 15 si sck int rx0bf 14 13 12 11 rx1bf 10 osc2 osc1 clkout/sof tx2rts 5 6 7 8 vss 9 tx0rts tx1rts mcp2515 txcan rxcan tx0rts osc1 clkout/sof osc2 cs v dd reset so sck int si rx0bf rx1bf v ss tx1rts tx2rts nc nc 13 12 1 2 3 4 5 6 7 8 9 20 19 18 17 16 15 14 11 10 18-lead pdip/soic 20-lead tssop stand-alone can controller with spi? interface
mcp2515 ds21801d-page 2 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 3 mcp2515 1.0 device overview the mcp2515 is a stand-alone can controller developed to simplify applications that require interfacing with a can bus. a simple block diagram of the mcp2515 is shown in figure 1-1. the device consists of three main blocks: 1. the can module, which includes the can protocol engine, masks, filters, transmit and receive buffers. 2. the control logic and registers that are used to configure the device and its operation. 3. the spi protocol block. an example system implementation using the device is shown in figure 1-2. 1.1 can module the can module handles all functions for receiving and transmitting messages on the can bus. messages are transmitted by first loading the appropriate message buffer and control registers. transmission is initiated by using control register bits via the spi interface or by using the transmit enable pins. status and errors can be checked by reading the appropriate registers. any message detected on the can bus is checked for errors and then matched against the user- defined filters to see if it should be moved into one of the two receive buffers. 1.2 control logic the control logic block controls the setup and operation of the mcp2515 by interfacing to the other blocks in order to pass information and control. interrupt pins are provided to allow greater system flexibility. there is one multi-purpose interrupt pin (as well as specific interrupt pins) for each of the receive registers that can be used to indicate a valid message has been received and loaded into one of the receive buffers. use of the specific interrupt pins is optional. the general purpose interrupt pin, as well as status registers (accessed via the spi interface), can also be used to determine when a valid message has been received. additionally, there are three pins available to initiate immediate transmission of a message that has been loaded into one of the three transmit registers. use of these pins is optional, as initiating message transmissions can also be accomplished by utilizing control registers, accessed via the spi interface. 1.3 spi protocol block the mcu interfaces to the device via the spi interface. writing to, and reading from, all registers is accomplished using standard spi read and write commands, in addition to specialized spi commands. figure 1-1: block diagram spi? interface logic spi bus int cs sck si so can protocol engine rxcan txcan control logic rx0bf rx1bf tx0rts tx1rts tx2rts tx and rx buffers masks and filters can module reset timing generation osc1 osc2 clkout control and interrupt registers
mcp2515 ds21801d-page 4 preliminary ? 2005 microchip technology inc. figure 1-2: example system implementation table 1-1: pinout description name pdip/soic pin # tssop pin # i/o/p type description alternate pin function txcan 1 1 o transmit output pin to can bus ? rxcan 2 2 i receive input pin from can bus ? clkout 3 3 o clock output pin with programmable prescaler start-of-frame signal tx0rts 4 4 i transmit buffer txb0 request-to-send. 100 k internal pull-up to v dd general purpose digital input. 100 k internal pull-up to v dd tx1rts 5 5 i transmit buffer txb1 request-to-send. 100 k internal pull-up to v dd general purpose digital input. 100 k internal pull-up to v dd tx2rts 6 7 i transmit buffer txb2 request-to-send. 100 k internal pull-up to v dd general purpose digital input. 100 k internal pull-up to v dd osc2 7 8 o oscillator output ? osc1 8 9 i oscillator input external clock input v ss 9 10 p ground reference for logic and i/o pins ? rx1bf 10 11 o receive buffer rxb1 interrupt pin or general purpose digital output general purpose digital output rx0bf 11 12 o receive buffer rxb0 interrupt pin or general purpose digital output general purpose digital output int 12 13 o interrupt output pin ? sck 13 14 i clock input pin for spi? interface ? si 14 16 i data input pin for spi interface ? so 15 17 o data output pin for spi interface ? cs 16 18 i chip select input pin for spi interface ? reset 17 19 i active low device reset input ? v dd 18 20 p positive supply for logic and i/o pins ? nc ? 6,15 ? no internal connection note: type identification: i = input; o = output; p = power node controller mcp2515 xcvr spi? tx rx canh canl node controller mcp2515 xcvr spi tx rx node controller mcp2515 xcvr spi tx rx
? 2005 microchip technology inc. preliminary ds21801d-page 5 mcp2515 1.4 transmit/receive buffers/masks/filters the mcp2515 has three transmit and two receive buffers, two acceptance masks (one for each receive buffer) and a total of six acceptance filters. figure 1-3 shows a block diagram of these buffers and their connection to the protocol engine. figure 1-3: can buffers and protocol engine block diagram acceptance filter rxf2 r x b 1 identifier data field data field identifier acceptance mask rxm1 acceptance filter rxf3 acceptance filter rxf4 acceptance filter rxf5 m a b acceptance filter rxf0 acceptance filter rxf1 r x b 0 txreq txb2 abtf mloa txerr message message queue control transmit byte sequencer txreq txb0 abtf mloa txerr message crc<14:0> comparator receive<7:0> transmit<7:0> receive error transmit error protocol rec tec errpas busoff finite state machine counter counter shift<14:0> {transmit<5:0>, receive<8:0>} transmit logic bit timing logic tx rx configuration registers clock generator protocol engine buffers txreq txb1 abtf mloa txerr message acceptance mask rxm0 a c c e p t a c c e p t sof
mcp2515 ds21801d-page 6 preliminary ? 2005 microchip technology inc. 1.5 can protocol engine the can protocol engine combines several functional blocks, shown in figure 1-4 and described below. 1.5.1 protocol finite state machine the heart of the engine is the finite state machine (fsm). the fsm is a sequencer that controls the sequential data stream between the tx/rx shift register, the crc register and the bus line. the fsm also controls the error management logic (eml) and the parallel data stream between the tx/rx shift registers and the buffers. the fsm ensures that the processes of reception, arbitration, transmission and error-signaling are performed according to the can protocol. the automatic retransmission of messages on the bus line is also handled by the fsm. 1.5.2 cyclic redundancy check the cyclic redundancy check register generates the cyclic redundancy check (crc) code, which is transmitted after either the control field (for messages with 0 data bytes) or the data field and is used to check the crc field of incoming messages. 1.5.3 error management logic the error management logic (eml) is responsible for the fault confinement of the can device. its two counters, the receive error counter (rec) and the transmit error counter (tec), are incremented and decremented by commands from the bit stream processor. based on the values of the error counters, the can controller is set into the states error-active, error-passive or bus-off. 1.5.4 bit timing logic the bit timing logic (btl) monitors the bus line input and handles the bus-related bit timing according to the can protocol. the btl synchronizes on a recessive- to-dominant bus transition at start-of-frame (hard syn- chronization) and on any further recessive-to-dominant bus line transition if the can controller itself does not transmit a dominant bit (resynchronization). the btl also provides programmable time segments to compensate for the propagation delay time, phase shifts and to define the position of the sample point within the bit time. the programming of the btl depends on the baud rate and external physical delay times. figure 1-4: can protocol engine block diagram bit timing logic crc<14:0> comparator receive<7:0> transmit<7:0> sample<2:0> majority decision stuffreg<5:0> comparator transmit logic receive error counter transmit error counter protocol fsm rx sam busmon rec/trm addr. recdata<7:0> trmdata<7:0> shift<14:0> (transmit<5:0>, receive<7:0>) tx rec tec errpas busoff interface to standard buffer sof
? 2005 microchip technology inc. preliminary ds21801d-page 7 mcp2515 2.0 can message frames the mcp2515 supports standard data frames, extended data frames and remote frames (standard and extended), as defined in the can 2.0b specification. 2.1 standard data frame the can standard data frame is shown in figure 2-1. as with all other frames, the frame begins with a start- of-frame (sof) bit, which is of the dominant state and allows hard synchronization of all nodes. the sof is followed by the arbitration field, consisting of 12 bits: the 11-bit identifier and the remote transmission request (rtr) bit. the rtr bit is used to distinguish a data frame (rtr bit dominant) from a remote frame (rtr bit recessive). following the arbitration field is the control field, consisting of six bits. the first bit of this field is the identifier extension (ide) bit, which must be dominant to specify a standard frame. the following bit, reserved bit zero (rb0), is reserved and is defined as a dominant bit by the can protocol. the remaining four bits of the control field are the data length code (dlc), which specifies the number of bytes of data (0 ? 8 bytes) contained in the message. after the control field is the data field, which contains any data bytes that are being sent, and is of the length defined by the dlc (0 ? 8 bytes). the cyclic redundancy check (crc) field follows the data field and is used to detect transmission errors. the crc field consists of a 15-bit crc sequence, followed by the recessive crc delimiter bit. the final field is the two-bit acknowledge (ack) field. during the ack slot bit, the transmitting node sends out a recessive bit. any node that has received an error-free frame acknowledges the correct reception of the frame by sending back a dominant bit (regardless of whether the node is configured to accept that specific message or not). the recessive acknowledge delimiter completes the acknowledge field and may not be overwritten by a dominant bit. 2.2 extended data frame in the extended can data frame, shown in figure 2-2, the sof bit is followed by the arbitration field, which consists of 32 bits. the first 11 bits are the most significant bits (msb) (base-ld) of the 29-bit identifier. these 11 bits are followed by the substitute remote request (srr) bit, which is defined to be recessive. the srr bit is followed by the lde bit, which is recessive to denote an extended can frame. it should be noted that if arbitration remains unresolved after transmission of the first 11 bits of the identifier, and one of the nodes involved in the arbitration is sending a standard can frame (11-bit identifier), the standard can frame will win arbitration due to the assertion of a dominant lde bit. also, the srr bit in an extended can frame must be recessive to allow the assertion of a dominant rtr bit by a node that is sending a standard can remote frame. the srr and lde bits are followed by the remaining 18 bits of the identifier (extended ld) and the remote transmission request bit. to enable standard and extended frames to be sent across a shared network, the 29-bit extended message identifier is split into 11-bit (most significant) and 18-bit (least significant) sections. this split ensures that the lde bit can remain at the same bit position in both the standard and extended frames. following the arbitration field is the six-bit control field. the first two bits of this field are reserved and must be dominant. the remaining four bits of the control field are the dlc, which specifies the number of data bytes contained in the message. the remaining portion of the frame (data field, crc field, acknowledge field, end-of-frame and intermis- sion) is constructed in the same way as a standard data frame (see section 2.1 ?standard data frame? ). 2.3 remote frame normally, data transmission is performed on an autonomous basis by the data source node (e.g., a sensor sending out a data frame). it is possible, however, for a destination node to request data from the source. to accomplish this, the destination node sends a remote frame with an identifier that matches the identifier of the required data frame. the appropriate data source node will then send a data frame in response to the remote frame request. there are two differences between a remote frame (shown in figure 2-3) and a data frame. first, the rtr bit is at the recessive state and, second, there is no data field. in the event of a data frame and a remote frame with the same identifier being transmitted at the same time, the data frame wins arbitration due to the dominant rtr bit following the identifier. in this way, the node that transmitted the remote frame receives the desired data immediately. 2.4 error frame an error frame is generated by any node that detects a bus error. an error frame, shown in figure 2-4, consists of two fields: an error flag field followed by an error delimiter field. there are two types of error flag fields. the type of error flag field sent depends upon the error status of the node that detects and generates the error flag field.
mcp2515 ds21801d-page 8 preliminary ? 2005 microchip technology inc. 2.4.1 active errors if an error-active node detects a bus error, the node interrupts transmission of the current message by generating an active error flag. the active error flag is composed of six consecutive dominant bits. this bit sequence actively violates the bit-stuffing rule. all other stations recognize the resulting bit-stuffing error and, in turn, generate error frames themselves, called error echo flags. the error flag field, therefore, consists of between six and twelve consecutive dominant bits (generated by one or more nodes). the error delimiter field (eight recessive bits) completes the error frame. upon completion of the error frame, bus activity returns to normal and the interrupted node attempts to resend the aborted message. 2.4.2 passive errors if an error-passive node detects a bus error, the node transmits an error-passive flag followed by the error delimiter field. the error-passive flag consists of six consecutive recessive bits. the error frame for an error- passive node consists of 14 recessive bits. from this it follows that, unless the bus error is detected by an error- active node or the transmitting node, the message will continue transmission because the error-passive flag does not interfere with the bus. if the transmitting node generates an error-passive flag, it will cause other nodes to generate error frames due to the resulting bit-stuffing violation. after transmission of an error frame, an error-passive node must wait for six consecutive recessive bits on the bus before attempting to rejoin bus communications. the error delimiter consists of eight recessive bits and allows the bus nodes to restart bus communications cleanly after an error has occurred. 2.5 overload frame an overload frame, shown in figure 2-5, has the same format as an active error frame. an overload frame, however, can only be generated during an interframe space. in this way, an overload frame can be differen- tiated from an error frame (an error frame is sent during the transmission of a message). the overload frame consists of two fields: an overload flag followed by an overload delimiter. the overload flag consists of six dominant bits followed by overload flags generated by other nodes (and, as for an active error flag, giving a maximum of twelve dominant bits). the overload delimiter consists of eight recessive bits. an overload frame can be generated by a node as a result of two conditions: 1. the node detects a dominant bit during the interframe space, an illegal condition. exception: the dominant bit is detected during the third bit of ifs. in this case, the receivers will interpret this as a sof. 2. due to internal conditions, the node is not yet able to begin reception of the next message. a node may generate a maximum of two sequential overload frames to delay the start of the next message. 2.6 interframe space the interframe space separates a preceding frame (of any type) from a subsequent data or remote frame. the interframe space is composed of at least three recessive bits called the intermission. this allows nodes time for internal processing before the start of the next message frame. after the intermission, the bus line remains in the recessive state (bus idle) until the next transmission starts. note: error echo flags typically occur when a localized disturbance causes one or more (but not all) nodes to send an error flag. the remaining nodes generate error flags in response (echo) to the original error flag. note: case 2 should never occur with the mcp2515 due to very short internal delays.
? 2005 microchip technology inc. preliminary ds21801d-page 9 mcp2515 figure 2-1: standard data frame 0 0 0 0 1 1 1 1 1 1 1 1 start-of-frame data frame (number of bits = 44 + 8n) 12 arbitration field id 10 11 id3 id0 identifier message filtering stored in buffers rtr ide rb0 dlc3 dlc0 6 4 control field data length code reserved bit 8n (0 n 8) data field 8 8 stored in transmit/receive buffers bit-stuffing 16 crc field 15 crc 7 end-of- frame crc del ack slot bit ack del ifs 1 1 1 1
mcp2515 ds21801d-page 10 preliminary ? 2005 microchip technology inc. figure 2-2: extended data frame 0 1 1 0 0 0 1 start-of-frame arbitration field 32 11 id10 id3 id0 ide identifier message filtering stored in buffers srr eid17 eid0 rtr rb1 rb0 dlc3 18 dlc0 6 control field 4 reserved bits data length code stored in transmit/receive buffers 8 8 data frame (number of bits = 64 + 8n) 8n (0 n 8) data field 1 1 1 1 1 1 1 1 16 crc field 15 crc crc del ack slot bit ack del end-of- frame 7 bit-stuffing ifs extended identifier 1 1 1
? 2005 microchip technology inc. preliminary ds21801d-page 11 mcp2515 figure 2-3: remote frame 0 1 1 1 0 0 start-of-frame arbitration field 32 11 id10 id3 id0 ide identifier message filtering srr eid17 eid0 rtr rb1 rb0 dlc3 18 dlc0 6 control field 4 reserved bits data length code extended identifier 1 1 1 1 1 1 1 1 1 16 crc field 15 crc crc del ack slot bit ack del end-of- frame 7 remote frame with extended identifier 1 1 1 ifs no data field
mcp2515 ds21801d-page 12 preliminary ? 2005 microchip technology inc. figure 2-4: active error frame 0 0 0 0 start-of-frame interrupted data frame 12 arbitration field id 10 11 id3 id0 identifier message filtering rtr ide rb0 dlc3 dlc0 6 4 control field data length code reserved bit 8n (0 n 8) data field 8 8 bit-stuffing 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 data frame or remote frame error frame 6 error flag 6 echo error flag 8 error delimiter inter-frame space or overload frame
? 2005 microchip technology inc. preliminary ds21801d-page 13 mcp2515 figure 2-5: overload frame 0 1 0 0 1 1 1 1 1 1 1 1 1 start-of-frame remote frame (number of bits = 44) 12 arbitration field id 10 11 id0 rtr ide rb0 dlc3 dlc0 6 4 control field 16 crc field 15 crc 7 end-of- frame crc del ack slot bit ack del 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 overload frame end-of-frame or error delimiter or overload delimiter 6 overload flag overload delimiter 8 inter-frame space or error frame
mcp2515 ds21801d-page 14 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 15 mcp2515 3.0 message transmission 3.1 transmit buffers the mcp2515 implements three transmit buffers. each of these buffers occupies 14 bytes of sram and are mapped into the device memory map. the first byte, txbnctrl, is a control register associated with the message buffer. the information in this register determines the conditions under which the message will be transmitted and indicates the status of the message transmission (see register 3-1). five bytes are used to hold the standard and extended identifiers, as well as other message arbitration information (see register 3-3 through register 3-7). the last eight bytes are for the eight possible data bytes of the message to be transmitted (see register 3-8). at a minimum, the txbnsidh, txbnsidl and txbndlc registers must be loaded. if data bytes are present in the message, the txbndm registers must also be loaded. if the message is to use extended identifiers, the txbneidm registers must also be loaded and the txbnsidl.exide bit set. prior to sending the message, the mcu must initialize the caninte.txine bit to enable or disable the generation of an interrupt when the message is sent. 3.2 transmit priority transmit priority is a prioritization within the mcp2515 of the pending transmittable messages. this is independent from, and not necessarily related to, any prioritization implicit in the message arbitration scheme built into the can protocol. prior to sending the sof, the priority of all buffers that are queued for transmission is compared. the transmit buffer with the highest priority will be sent first. for example, if transmit buffer 0 has a higher priority setting than transmit buffer 1, buffer 0 will be sent first. if two buffers have the same priority setting, the buffer with the highest buffer number will be sent first. for example, if transmit buffer 1 has the same priority setting as transmit buffer 0, buffer 1 will be sent first. there are four levels of transmit priority. if txbnctrl.txp<1:0> for a particular message buffer is set to 11 , that buffer has the highest possible priority. if txbnctrl.txp<1:0> for a particular message buffer is 00 , that buffer has the lowest possible priority. 3.3 initiating transmission in order to initiate message transmission, the txbnctrl.txreq bit must be set for each buffer to be transmitted. this can be accomplished by: ? writing to the register via the spi write command ? sending the spi rts command ? setting the tx n rts pin low for the particular transmit buffer(s) that are to be transmitted if transmission is initiated via the spi interface, the txreq bit can be set at the same time as the txp priority bits. when txbnctrl.txreq is set, the txbnctrl.abtf, txbnctrl.mloa and txbnctrl.txerr bits will be cleared automatically. once the transmission has completed successfully, the txbnctrl.txreq bit will be cleared, the canintf.txnif bit will be set and an interrupt will be generated if the caninte.txnie bit is set. if the message transmission fails, the txbnctrl.txreq will remain set. this indicates that the message is still pending for transmission and one of the following condition flags will be set: ? if the message started to transmit but encoun- tered an error condition, the txbnctrl.txerr and the canintf.merrf bits will be set and an interrupt will be generated on the int pin if the caninte.merre bit is set ? if the message is lost, arbitration at the txbnctrl.mloa bit will be set 3.4 one-shot mode one-shot mode ensures that a message will only attempt to transmit one time. normally, if a can message loses arbitration, or is destroyed by an error frame, the message is retransmitted. with one-shot mode enabled, a message will only attempt to transmit one time, regardless of arbitration loss or error frame. one-shot mode is required to maintain time slots in deterministic systems, such as ttcan. note: the txbnctrl.txreq bit must be clear (indicating the transmit buffer is not pending transmission) before writing to the transmit buffer. note: setting the txbnctrl.txreq bit does not initiate a message transmission. it merely flags a message buffer as being ready for transmission. transmission will start when the device detects that the bus is available. note: if one-shot mode is enabled (canctrl.osm), the above conditions will still exist. however, the txreq bit will be cleared and the message will not attempt transmission a second time.
mcp2515 ds21801d-page 16 preliminary ? 2005 microchip technology inc. 3.5 txnrts pins the tx n rts pins are input pins that can be configured as: ? request-to-send inputs, which provides an alternative means of initiating the transmission of a message from any of the transmit buffers ? standard digital inputs configuration and control of these pins is accomplished using the txrtsctrl register (see register 3-2). the txrtsctrl register can only be modified when the mcp2515 is in configuration mode (see section 10.0 ?modes of operation? ). if configured to operate as a request-to-send pin, the pin is mapped into the respective txbnctrl.txreq bit for the transmit buffer. the txreq bit is latched by the falling edge of the tx n rts pin. the tx n rts pins are designed to allow them to be tied directly to the rx n bf pins to automatically initiate a message transmission when the rx n bf pin goes low. the tx n rts pins have internal pull-up resistors of 100 k (nominal). 3.6 aborting transmission the mcu can request to abort a message in a specific message buffer by clearing the associated txbnctrl.txreq bit. in addition, all pending messages can be requested to be aborted by setting the canctrl.abat bit. this bit must be reset (typically after the txreq bits have been verified to be cleared) to continue transmitting messages. the canctrl.abtf flag will only be set if the abort was requested via the canctrl.abat bit. aborting a message by resetting the txreq bit does not cause the abtf bit to be set. note: messages that were transmitting when the abort was requested will continue to transmit. if the message does not successfully complete transmission (i.e., lost arbitration or was interrupted by an error frame), it will then be aborted.
? 2005 microchip technology inc. preliminary ds21801d-page 17 mcp2515 figure 3-1: transmit message flowchart start is can bus available to start transmission? no examine txbnctrl.txp <1:0> to are any txbnctrl.txreq ? bits = 1 the message transmission sequence begins when the device determines that the txbnctrl.txreq for any of the transmit registers has been set. clear: txbnctrl.abtf txbnctrl.mloa txbnctrl.txerr ye s is txbnctrl.txreq= 0 or canctrl.abat= 1 clearing the txbnctrl.txreq bit while it is set, or setting the can- ctrl.abat bit before the message has started transmission, will abort the message. no transmit message was message transmitted successfully? no yes clear txbnctrl.txreq caninte.txnie= 1 ? generate interrupt yes message ye s set set txbnctrl.txerr lost determine highest priority message no ? set txb n ctrl.mloa the caninte.txnie bit determines if an interrupt should be generated when a message is successfully transmitted. goto start cantinf.txnif yes no message error or lost arbitration arbitration error caninte.meere? no generate interrupt yes set cantinf.merrf ?
mcp2515 ds21801d-page 18 preliminary ? 2005 microchip technology inc. register 3-1: txbnctrl ? transmit buffer n control register (address: 30h, 40h, 50h) u-0 r-0 r-0 r-0 r/w-0 u-0 r/w-0 r/w-0 ? abtf mloa txerr txreq ? txp1 txp0 bit 7 bit 0 bit 7 unimplemented: read as ? 0 ? bit 6 abtf : message aborted flag bit 1 = message was aborted 0 = message completed transmission successfully bit 5 mloa : message lost arbitration bit 1 = message lost arbitration while being sent 0 = message did not lose arbitration while being sent bit 4 txerr : transmission error detected bit 1 = a bus error occurred while the message was being transmitted 0 = no bus error occurred while the message was being transmitted bit 3 txreq : message transmit request bit 1 = buffer is currently pending transmission (mcu sets this bit to request message be transmitted - bit is automatically cleared when the message is sent) 0 = buffer is not currently pending transmission (mcu can clear this bit to request a message abort) bit 2 unimplemented: read as ? 0 ? bit 1-0 txp : transmit buffer priority <1:0> bits 11 = highest message priority 10 = high intermediate message priority 11 = low intermediate message priority 00 = lowest message priority legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 19 mcp2515 register 3-2: txrtsctrl ? txnrts pin control and status register (address: 0dh) register 3-3: txbnsidh ? transmit buffer n standard identifier high (address: 31h, 41h, 51h) u-0 u-0 r-x r-x r-x r/w-0 r/w-0 r/w-0 ? ? b2rts b1rts b0rts b2rtsm b1rtsm b0rtsm bit 7 bit 0 bit 7 unimplemented: read as ? 0 ? bit 6 unimplemented: read as ? 0 ? bit 5 b2rts : tx2rts pin state bit - reads state of tx2rts pin when in digital input mode - reads as ?0? when pin is in ?request-to-send? mode bit 4 b1rts : tx1rtx pin state bit - reads state of tx1rts pin when in digital input mode - reads as ? 0 ? when pin is in ?request-to-send? mode bit 3 b0rts : tx0rts pin state bit - reads state of tx0rts pin when in digital input mode - reads as ? 0 ? when pin is in ?request-to-send? mode bit 2 b2rtsm : tx2rts pin mode bit 1 = pin is used to request message transmission of txb2 buffer (on falling edge) 0 = digital input bit 1 b1rtsm : tx1rts pin mode bit 1 = pin is used to request message transmission of txb1 buffer (on falling edge) 0 = digital input bit 0 b0rtsm : tx0rts pin mode bit 1 = pin is used to request message transmission of txb0 buffer (on falling edge) 0 = digital input legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid10sid9sid8sid7sid6sid5sid4sid3 bit 7 bit 0 bit 7-0 sid : standard identifier bits <10:3> legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 20 preliminary ? 2005 microchip technology inc. register 3-4: txbnsidl ? transmit buffer n standard identifier low (address: 32h, 42h, 52h) register 3-5: txbneid8 ? transmit buffer n extended identifier high (address: 33h, 43h, 53h) register 3-6: txbneid0 ? transmit buffer n extended identifier low (address: 34h, 44h, 54h) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid2 sid1 sid0 ? exide ?eid17eid16 bit 7 bit 0 bit 7-5 sid : standard identifier bits <2:0> bit 4 unimplemented : reads as ? 0 ? bit 3 exide : extended identifier enable bit 1 = message will transmit extended identifier 0 = message will transmit standard identifier bit 2 unimplemented : reads as ? 0 ? bit 1-0 eid : extended identifier bits <17:16> legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 7 bit 0 bit 7-0 eid : extended identifier bits <15:8> legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 bit 7-0 eid : extended identifier bits <7:0> legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 21 mcp2515 register 3-7: txbndlc - transmit buffer n data length code (address: 35h, 45h, 55h) register 3-8: txbndm ? transmit buffer n data byte m (address: 36h - 3dh, 46h - 4dh, 56h - 5dh) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x ?rtr ? ? dlc3dlc2dlc1dlc0 bit 7 bit 0 bit 7 unimplemented : reads as ? 0 ? bit 6 rtr : remote transmission request bit 1 = transmitted message will be a remote transmit request 0 = transmitted message will be a data frame bit 5-4 unimplemented : reads as ?0? bit 3-0 dlc : data length code <3:0> bits sets the number of data bytes to be transmitted (0 to 8 bytes) note: it is possible to set the dlc to a value greater than 8, however only 8 bytes are transmitted legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x txbndm 7 txbndm 6 txbndm 5 txbndm 4 txbndm 3 txbndm 2 txbndm 1 txbndm 0 bit 7 bit 0 bit 7-0 txbnd m 7:txbnd m 0 : transmit buffer n data field bytes m legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 22 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 23 mcp2515 4.0 message reception 4.1 receive message buffering the mcp2515 includes two full receive buffers with multiple acceptance filters for each. there is also a separate message assembly buffer (mab) that acts as a third receive buffer (see figure 4-2). 4.1.1 message assembly buffer of the three receive buffers, the mab is always committed to receiving the next message from the bus. the mab assembles all messages received. these messages will be transferred to the rxbn buffers (see register 4-4 to register 4-9) only if the acceptance filter criteria is met. 4.1.2 rxb0 and rxb1 the remaining two receive buffers, called rxb0 and rxb1, can receive a complete message from the protocol engine via the mab. the mcu can access one buffer, while the other buffer is available for message reception, or for holding a previously received message. 4.1.3 receive flags/interrupts when a message is moved into either of the receive buffers, the appropriate canintf.rxnif bit is set. this bit must be cleared by the mcu in order to allow a new message to be received into the buffer. this bit provides a positive lockout to ensure that the mcu has finished with the message before the mcp2515 attempts to load a new message into the receive buffer. if the caninte.rxnie bit is set, an interrupt will be generated on the int pin to indicate that a valid message has been received. in addition, the associated rxnbf pin will drive low if configured as a receive buffer full pin. see section 4.4 ?rx0bf and rx1bf pins? for details. 4.2 receive priority rxb0, the higher priority buffer, has one mask and two message acceptance filters associated with it. the received message is applied to the mask and filters for rxb0 first. rxb1 is the lower priority buffer, with one mask and four acceptance filters associated with it. in addition to the message being applied to the rb0 mask and filters first, the lower number of acceptance filters makes the match on rxb0 more restrictive and implies a higher priority for that buffer. when a message is received, bits <3:0> of the rxbnctrl register will indicate the acceptance filter number that enabled reception and whether the received message is a remote transfer request. 4.2.1 rollover additionally, the rxb0ctrl register can be configured such that, if rxb0 contains a valid message and another valid message is received, an overflow error will not occur and the new message will be moved into rxb1, regardless of the acceptance criteria of rxb1. 4.2.2 rxm bits the rxbnctrl.rxm bits set special receive modes. normally, these bits are cleared to 00 to enable reception of all valid messages as determined by the appropriate acceptance filters. in this case, the determination of whether or not to receive standard or extended messages is determined by the rfxnsidl.exide bit in the acceptance filter register. if the rxbnctrl.rxm bits are set to 01 or 10 , the receiver will only accept messages with standard or extended identifiers, respectively. if an acceptance filter has the rfxnsidl.exide bit set such that it does not correspond with the rxbnctrl.rxm mode, that acceptance filter is rendered useless. these two modes of rxbnctrl.rxm bits can be used in systems where it is known that only standard or extended messages will be on the bus. if the rxbnctrl.rxm bits are set to 11 , the buffer will receive all messages, regardless of the values of the acceptance filters. also, if a message has an error before the eof, that portion of the message assem- bled in the mab before the error frame will be loaded into the buffer. this mode has some value in debugging a can system and would not be used in an actual system environment. note: the entire contents of the mab is moved into the receive buffer once a message is accepted. this means that, regardless of the type of identifier (standard or extended) and the number of data bytes received, the entire receive buffer is overwritten with the mab contents. therefore, the contents of all registers in the buffer must be assumed to have been modified when any message is received.
mcp2515 ds21801d-page 24 preliminary ? 2005 microchip technology inc. 4.3 start-of-frame signal if enabled, the start-of-frame signal is generated on the sof pin at the beginning of each can message detected on the rxcan pin. the rxcan pin monitors an idle bus for a recessive- to-dominant edge. if the dominant condition remains until the sample point, the mcp2515 interprets this as a sof and a sof pulse is generated. if the dominant condition does not remain until the sample point, the mcp2515 interprets this as a glitch on the bus and no sof signal is generated. figure 4-1 illustrates sof signalling and glitch-filtering. as with one-shot mode, one use for sof signaling is for ttcan-type systems. in addition, by monitoring both the rxcan pin and the sof pin, a mcu can detect early physical bus problems by detecting small glitches before they affect the can communications. 4.4 rx0bf and rx1bf pins in addition to the int pin, which provides an interrupt signal to the mcu for many different conditions, the receive buffer full pins (rx0bf and rx1bf ) can be used to indicate that a valid message has been loaded into rxb0 or rxb1, respectively. the pins have three different configurations (register 4-1): 1. disabled. 2. buffer full interrupt. 3. digital output. 4.4.1 disabled the rxbnbf pins can be disabled to the high- impedance state by clearing bfpctrl.bnbfe. 4.4.2 configured as buffer full the rxb n bf pins can be configured to act as either buffer full interrupt pins or as standard digital outputs. configuration and status of these pins is available via the bfpctrl register (register 4-3). when set to operate in interrupt mode (by setting bfpctrl.bxbfe and bfpctrl.bxbfm bits), these pins are active-low and are mapped to the canintf.rxnif bit for each receive buffer. when this bit goes high for one of the receive buffers (indicating that a valid message has been loaded into the buffer), the corresponding rxbnbf pin will go low. when the canintf.rxnif bit is cleared by the mcu, the corresponding interrupt pin will go to the logic-high state until the next message is loaded into the receive buffer. figure 4-1: start-of-frame signaling start-of-frame bit sample point id bit rxcan sof expected start-of-frame bit sample point bus idle rxcan sof expected normal sof signaling glitch-filtering
? 2005 microchip technology inc. preliminary ds21801d-page 25 mcp2515 4.4.3 configured as digital output when used as digital outputs, the bfpctrl.bxbfm bit must be cleared and bfpctrl.bnbfe must be set for the associated buffer. in this mode, the state of the pin is controlled by the bfpctrl.bnbfs bits. writing a ? 1 ? to the bnbfs bit will cause a high level to be driven on the associated buffer full pin, while a ? 0 ? will cause the pin to drive low. when using the pins in this mode, the state of the pin should be modified only by using the bit modify spi command to prevent glitches from occurring on either of the buffer full pins. table 4-1: configuring rxnbf pins figure 4-2: receive buffer block diagram bnbfe bnbfm bnbfs pin status 0xx disabled, high-impedance 11x receive buffer interrupt 100 digital output = 0 101 digital output = 1 acceptance mask rxm1 acceptance filter rxf2 acceptance filter rxf3 acceptance filter rxf4 acceptance filter rxf5 acceptance mask rxm0 acceptance filter rxf0 acceptance filter rxf1 identifier data field data field identifier note: messages received in the mab are intially applied to the mask and filters of rxb0. in addition, only one filter match occurs (e.g., if the message matches both rxf0 and rxf2, the match will be for rxf0 and the message will be moved into rxb0). a c c e p t a c c e p t r x b 0 r x b 1 m a b
mcp2515 ds21801d-page 26 preliminary ? 2005 microchip technology inc. figure 4-3: receive flow flowchart set rxbf0 start detect start of message? valid message received? generate error meets a filter criteria is canintf.rx0if = 0 ? go to start move message into rxb0 set rxb0ctrl.filhit <2:0> is canintf.rx1if = 0 ? move message into rxb1 set canintf.rx1if = 1 yes no generate interrupt on int ye s ye s no no ye s ye s no no yes ye s frame no yes no begin loading message into message assembly buffer (mab) according to which filter criteria was met set rxb0ctrl.filhit <0> according to which filter criteria set canstat <3:0> accord- ing to which receive buffer the message was loaded into is rxb0ctrl.bukt = 1 ? generate overflow error: set eflg.rx1ovr is caninte.errie = 1 ? no go to start ye s no are bfpctrl.b0bfm = 1 bf1ctrl.b0bfe = 1 ? and pin = 0 no set rxbf1 pin = 0 no ye s yes caninte.rx0ie = 1 ? caninte.rx1ie = 1 ? rxb1 rxb0 set eflg.rx0ovr generate overflow error: set canintf.rx0if = 1 are bfpctrl.b1bfm = 1 bf1ctrl.b1bfe = 1 ? and meets a filter criteria for rxb1? for rxb0? no ye s generate interrupt on int determines if the receive register is empty and able to accept a new message determines if rxb0 can roll over into rxb1, if it is full.
? 2005 microchip technology inc. preliminary ds21801d-page 27 mcp2515 register 4-1: rxb0ctrl ? receive buffer 0 control (address: 60h) u-0 r/w-0 r/w-0 u-0 r-0 r/w-0 r-0 r-0 ? rxm1 rxm0 ? rxrtr bukt bukt1 filhit0 bit 7 bit 0 bit 7 unimplemented: read as ?0? bit 6-5 rxm : receive buffer operating mode bits 11 = turn mask/filters off; receive any message 10 = receive only valid messages with extended identifiers that meet filter criteria 01 = receive only valid messages with standard identifiers that meet filter criteria 00 = receive all valid messages using either standard or extended identifiers that meet filter criteria bit 4 unimplemented: read as ? 0 ? bit 3 rxrtr : received remote transfer request bit 1 = remote transfer request received 0 = no remote transfer request received bit 2 bukt : rollover enable bit 1 = rxb0 message will rollover and be written to rxb1 if rxb0 is full 0 = rollover disabled bit 1 bukt1 : read-only copy of bukt bit (used internally by the mcp2515) bit 0 filhit : filter hit bit - indicates which acceptance filter enabled reception of message 1 = acceptance filter 1 (rxf1) 0 = acceptance filter 0 (rxf0) note: if a rollover from rxb0 to rxb1 occurs, the fi lhit bit will reflect the filter that accepted the message that rolled over. legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 28 preliminary ? 2005 microchip technology inc. register 4-2: rxb1ctrl ? receive buffer 1 control (address: 70h) u-0 r/w-0 r/w-0 u-0 r-0 r-0 r-0 r-0 ? rxm1 rxm0 ? rxrtr filhit2 filhit1 filhit0 bit 7 bit 0 bit 7 unimplemented: read as ? 0 ? bit 6-5 rxm : receive buffer operating mode bits 11 = turn mask/filters off; receive any message 10 = receive only valid messages with extended identifiers that meet filter criteria 01 = receive only valid messages with standard identifiers that meet filter criteria 00 = receive all valid messages using either standard or extended identifiers that meet filter criteria bit 4 unimplemented: read as ? 0 ? bit 3 rxrtr : received remote transfer request bit 1 = remote transfer request received 0 = no remote transfer request received bit 2-0 filhit : filter hit bits - indicates which acceptance filter enabled reception of message 101 = acceptance filter 5 (rxf5) 100 = acceptance filter 4 (rxf4) 011 = acceptance filter 3 (rxf3) 010 = acceptance filter 2 (rxf2) 001 = acceptance filter 1 (rxf1) (only if bukt bit set in rxb0ctrl) 000 = acceptance filter 0 (rxf0) (only if bukt bit set in rxb0ctrl) legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 29 mcp2515 register 4-3: bfpctrl ? rxnbf pin control and status (address: 0ch) register 4-4: rxbnsidh ? receive buffer n standard identifier high (address: 61h, 71h) u-0 u-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 ? ? b1bfs b0bfs b1bfe b0bfe b1bfm b0bfm bit 7 bit 0 bit 7 unimplemented: read as ? 0 ? bit 6 unimplemented: read as ? 0 ? bit 5 b1bfs : rx1bf pin state bit (digital output mode only) - reads as ? 0 ? when rx1bf is configured as interrupt pin bit 4 b0bfs : rx0bf pin state bit (digital output mode only) - reads as ? 0 ? when rx0bf is configured as interrupt pin bit 3 b1bfe : rx1bf pin function enable bit 1 = pin function enabled, operation mode determined by b1bfm bit 0 = pin function disabled, pin goes to high-impedance state bit 2 b0bfe : rx0bf pin function enable bit 1 = pin function enabled, operation mode determined by b0bfm bit 0 = pin function disabled, pin goes to high-impedance state bit 1 b1bfm : rx1bf pin operation mode bit 1 = pin is used as interrupt when valid message loaded into rxb1 0 = digital output mode bit 0 b0bfm : rx0bf pin operation mode bit 1 = pin is used as interrupt when valid message loaded into rxb0 0 = digital output mode legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r-x r-x r-x r-x r-x r-x r-x r-x sid10sid9sid8sid7sid6sid5sid4sid3 bit 7 bit 0 bit 7-0 sid : standard identifier bits <10:3> these bits contain the eight most significant bits of the standard identifier for the received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 30 preliminary ? 2005 microchip technology inc. register 4-5: rxbnsidl ? receive buffer n standard identifier low (address: 62h, 72h) register 4-6: rxbneid8 ? receive buffer n extended identifier high (address: 63h, 73h) r-x r-x r-x r-x r-x u-0 r-x r-x sid2 sid1 sid0 srr ide ?eid17eid16 bit 7 bit 0 bit 7-5 sid : standard identifier bits <2:0> these bits contain the three least significant bits of the standard identifier for the received message bit 4 srr: standard frame remote transmit request bit (valid only if ide bit = ? 0 ?) 1 = standard frame remote transmit request received 0 = standard data frame received bit 3 ide: extended identifier flag bit this bit indicates whether the received message was a standard or an extended frame 1 = received message was an extended frame 0 = received message was a standard frame bit 2 unimplemented: reads as ? 0 ? bit 1-0 eid : extended identifier bits <17:16> these bits contain the two most significant bits of the extended identifier for the received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r-x r-x r-x r-x r-x r-x r-x r-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 7 bit 0 bit 7-0 eid : extended identifier bits <15:8> these bits hold bits 15 through 8 of the extended identifier for the received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 31 mcp2515 register 4-7: rxbneid0 ? receive buffer n extended identifier low (address: 64h, 74h) register 4-8: rxbndlc ? receive buffer n data lenght code (address: 65h, 75h) register 4-9: rxbndm ? receive buffer n data byte m (address: 66h - 6dh, 76h - 7dh) r-x r-x r-x r-x r-x r-x r-x r-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 bit 7-0 eid : extended identifier bits <7:0> these bits hold the least significant eight bits of the extended identifier for the received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown u-0 r-x r-x r-x r-x r-x r-x r-x ? rtr rb1 rb0 dlc3 dlc2 dlc1 dlc0 bit 7 bit 0 bit 7 unimplemented: reads as ?0? bit 6 rtr : extended frame remote transmission request bit (valid only when rxbnsidl.ide = ? 1 ?) 1 = extended frame remote transmit request received 0 = extended data frame received bit 5 rb1: reserved bit 1 bit 4 rb0: reserved bit 0 bit 3-0 dlc : data length code bits <3:0> indicates number of data bytes that were received legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r-x r-x r-x r-x r-x r-x r-x r-x rbndm7 rbndm6 rbndm5 rbndm4 rbndm3 rbndm2 rbndm1 rbndm0 bit 7 bit 0 bit 7-0 rbndm7:rbndm0 : receive buffer n data field bytes m eight bytes containing the data bytes for the received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 32 preliminary ? 2005 microchip technology inc. 4.5 message acceptance filters and masks the message acceptance filters and masks are used to determine if a message in the message assembly buffer should be loaded into either of the receive buffers (see figure 4-5). once a valid message has been received into the mab, the identifier fields of the message are compared to the filter values. if there is a match, that message will be loaded into the appropriate receive buffer. 4.5.1 data byte filtering when receiving standard data frames (11-bit identifier), the mcp2515 automatically applies 16 bits of masks and filters normally associated with extended identifiers to the first 16 bits of the data field (data bytes 0 and 1). figure 4-4 illustrates how masks and filters apply to extended and standard data frames. data byte filtering reduces the load on the mcu when implementing higher layer protocols (hlps) that filter on the first data byte (e.g., devicenet?). 4.5.2 filter matching the filter masks (see register 4-14 through register 4-17) are used to determine which bits in the identifier are examined with the filters. a truth table is shown in table 4-2 that indicates how each bit in the identifier is compared to the masks and filters to deter- mine if the message should be loaded into a receive buffer. the mask essentially determines which bits to apply the acceptance filters to. if any mask bit is set to a zero, that bit will automatically be accepted, regardless of the filter bit. table 4-2: filter/mask truth table as shown in the receive buffers block diagram (figure 4-2), acceptance filters rxf0 and rxf1 (and filter mask rxm0) are associated with rxb0. filters rxf2, rxf3, rxf4, rxf5 and mask rxm1 are associated with rxb1. figure 4-4: masks and filters apply to can frames mask bit n filter bit n message identifier bit accept or reject bit n 0x x accept 10 0 accept 10 1 reject 11 0 reject 11 1 accept note: x = don?t care extended frame standard data frame id10 id0 eid17 eid0 masks and filters apply to the entire 29-bit id field id10 id0 data byte 0 data byte 1 11-bit id standard frame * 16-bit data filtering * * the two msb (eid17 and eid16) mask and filter bits are not used.
? 2005 microchip technology inc. preliminary ds21801d-page 33 mcp2515 4.5.3 filhit bits filter matches on received messages can be determined by the filhit bits in the associated rxbnctrl register. rxb0ctrl.filhit0 for buffer 0 and rxb1ctrl.filhit<2:0> for buffer 1. the three filhit bits for receive buffer 1 (rxb1) are coded as follows: - 101 = acceptance filter 5 (rxf5) - 100 = acceptance filter 4 (rxf4) - 011 = acceptance filter 3 (rxf3) - 010 = acceptance filter 2 (rxf2) - 001 = acceptance filter 1 (rxf1) - 000 = acceptance filter 0 (rxf0) rxb0ctrl contains two copies of the bukt bit and the filhit<0> bit. the coding of the bukt bit enables these three bits to be used similarly to the rxb1ctrl.filhit bits and to distinguish a hit on filter rxf0 and rxf1 in either rxb0 or after a roll over into rxb1. - 111 = acceptance filter 1 (rxb1) - 110 = acceptance filter 0 (rxb1) - 001 = acceptance filter 1 (rxb0) - 000 = acceptance filter 0 (rxb0) if the bukt bit is clear, there are six codes corresponding to the six filters. if the bukt bit is set, there are six codes corresponding to the six filters, plus two additional codes corresponding to rxf0 and rxf1 filters that roll over into rxb1. 4.5.4 multiple filter matches if more than one acceptance filter matches, the filhit bits will encode the binary value of the lowest numbered filter that matched. for example, if filter rxf2 and filter rxf4 match, filhit will be loaded with the value for rxf2. this essentially prioritizes the acceptance filters with a lower-numbered filter having higher priority. messages are compared to filters in ascending order of filter number. this also insures that the message will only be received into one buffer. this implies that rxb0 has a higher priority than rxb1. 4.5.5 configuring the masks and filters the mask and filter registers can only be modified when the mcp2515 is in configuration mode (see section 10.0 ?modes of operation? ). figure 4-5: message acceptance mask and filter operation note: 000 and 001 can only occur if the bukt bit in rxb0ctrl is set, allowing rxb0 messages to roll over into rxb1. acceptance filter register acceptance mask register rxrqst message assembly buffer rxfn 0 rxfn 1 rxfn n rxmn 0 rxmn 1 rxmn n identifier
mcp2515 ds21801d-page 34 preliminary ? 2005 microchip technology inc. register 4-10: rxfnsidh ? filter n standard identifier high (address: 00h, 04h, 08h, 10h, 14h, 18h) register 4-11: rxfnsidl ? filter n standard identifier low (address: 01h, 05h, 09h, 11h, 15h, 19h) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x sid10sid9sid8sid7sid6sid5sid4sid3 bit 7 bit 0 bit 7-0 sid : standard identifier filter bits <10:3> these bits hold the filter bits to be applied to bits <10:3> of the standard identifier portion of a received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-x r/w-x r/w-x u-0 r/w-x u-0 r/w-x r/w-x sid2 sid1 sid0 ? exide ?eid17eid16 bit 7 bit 0 bit 7-5 sid : standard identifier filter bits <2:0> these bits hold the filter bits to be applied to bits <2:0> of the standard identifier portion of a received message bit 4 unimplemented : reads as ? 0 ? bit 3 exide : extended identifier enable bit 1 = filter is applied only to extended frames 0 = filter is applied only to standard frames bit 2 unimplemented : reads as ? 0 ? bit 1-0 eid : extended identifier filter bits <17:16> these bits hold the filter bits to be applied to bits <17:16> of the extended identifier portion of a received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 35 mcp2515 register 4-12: rxfneid8 ? filter n extended identifier high (address: 02h, 06h, 0ah, 12h, 16h, 1ah) register 4-13: rxfneid0 ? filter n extended identifier low (address: 03h, 07h, 0bh, 13h, 17h, 1bh) register 4-14: rxmnsidh ? mask n standard identifier high (address: 20h, 24h) r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 7 bit 0 bit 7-0 eid : extended identifier bits <15:8> these bits hold the filter bits to be applied to bits <15:8> of the extended identifier portion of a received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x r/w-x eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 bit 7-0 eid : extended identifier bits <7:0> these bits hold the filter bits to be applied to the bits <7:0> of the extended identifier portion of a received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sid10sid9sid8sid7sid6sid5sid4sid3 bit 7 bit 0 bit 7-0 sid : standard identifier mask bits <10:3> these bits hold the mask bits to be applied to bits <10:3> of the standard identifier portion of a received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 36 preliminary ? 2005 microchip technology inc. register 4-15: rxmnsidl ? mask n standard identifier low (address: 21h, 25h) register 4-16: rxmneid8 ? mask n extended identifier high (address: 22h, 26h) register 4-17: rxmneid0 ? mask n extended identifier low (address: 23h, 27h) r/w-0 r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 r/w-0 sid2 sid1 sid0 ? ? ?eid17eid16 bit 7 bit 0 bit 7-5 sid : standard identifier mask bits <2:0> these bits hold the mask bits to be applied to bits<2:0> of the standard identifier portion of a received message bit 4-2 unimplemented : reads as ?0? bit 1-0 eid : extended identifier mask bits <17:16> these bits hold the mask bits to be applied to bits <17:16> of the extended identifier portion of a received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 eid15 eid14 eid13 eid12 eid11 eid10 eid9 eid8 bit 7 bit 0 bit 7-0 eid : extended identifier bits <15:8> these bits hold the filter bits to be applied to bits <15:8> of the extended identifier portion of a received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 eid7 eid6 eid5 eid4 eid3 eid2 eid1 eid0 bit 7 bit 0 bit 7-0 eid : extended identifier mask bits <7:0> these bits hold the mask bits to be applied to the bits <7:0> of the extended identifier portion of a received message legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 37 mcp2515 5.0 bit timing all nodes on a given can bus must have the same nominal bit rate. the can protocol uses non return to zero (nrz) coding, which does not encode a clock within the data stream. therefore, the receive clock must be recovered by the receiving nodes and synchronized to the transmitter?s clock. as oscillators and transmission times may vary from node to node, the receiver must have some type of phase lock loop (pll) synchronized to data transmission edges to synchronize and maintain the receiver clock. since the data is nrz-coded, it is necessary to include bit-stuffing to insure that an edge occurs at least every six bit times to maintain the digital phase lock loop (dpll) synchronization. the bit timing of the mcp2515 is implemented using a dpll that is configured to synchronize to the incoming data, as well as provide the nominal timing for the transmitted data. the dpll breaks each bit time into multiple segments made up of minimal periods of time, called the time quanta (tq). bus timing functions executed within the bit time frame (such as synchronization to the local oscillator, network transmission delay compensation and sample point positioning) are defined by the programmable bit timing logic of the dpll. 5.1 the can bit time all devices on the can bus must use the same bit rate. however, all devices are not required to have the same master oscillator clock frequency. for the different clock frequencies of the individual devices, the bit rate has to be adjusted by appropriately setting the baud rate prescaler and number of time quanta in each segment. the can bit time is made up of non-overlapping segments. each of these segments are made up of integer units called time quanta (tq), explained later in this data sheet. the nominal bit rate (nbr) is defined in the can specification as the number of bits per second transmitted by an ideal transmitter with no resynchronization. it can be described with the equation: equation 5-1: nominal bit time the nominal bit time (nbt) (t bit ) is made up of non- overlapping segments (figure 5-1). therefore, the nbt is the summation of the following segments: associated with the nbt are the sample point, synchronization jump width (sjw) and information processing time (ipt), which are explained later. synchronization segment the synchronization segment (syncseg) is the first segment in the nbt and is used to synchronize the nodes on the bus. bit edges are expected to occur within the syncseg. this segment is fixed at 1 tq. figure 5-1: can bit time segments nbr f bit 1 t bit ------ - == t bit t syncseg t propseg t ps1 t ps2 +++ = nominal bit time (nbt), t bit sample point syncseg propseg phaseseg1 (ps1) phaseseg2 (ps2)
mcp2515 ds21801d-page 38 preliminary ? 2005 microchip technology inc. propagation segment the propagation segment (propseg) exists to compensate for physical delays between nodes. the propagation delay is defined as twice the sum of the signal?s propagation time on the bus line, including the delays associated with the bus driver. the propseg is programmable from 1 ? 8 tq. phase segment 1 (ps1) and phase segment 2 (ps2) the two phase segments, ps1 and ps2, are used to compensate for edge phase errors on the bus. ps1 can be lengthened (or ps2 shortened) by resyncronization. ps1 is programmable from 1 ? 8 tq and ps2 is programmable from 2 ? 8 tq. sample point the sample point is the point in the bit time at which the logic level is read and interpreted. the sample point is located at the end of ps1. the exception to this rule is if the sample mode is configured to sample three times per bit. in this case, while the bit is still sampled at the end of ps1, two additional samples are taken at one- half tq intervals prior to the end of ps1, with the value of the bit being determined by a majority decision. information processing time the information processing time (ipt) is the time required for the logic to determine the bit level of a sampled bit. the ipt begins at the sample point, is measured in tq and is fixed at 2 tq for the microchip can module. since ps2 also begins at the sample point and is the last segment in the bit time, it is required that the ps2 minimum is not less than the ipt. therefore: synchronization jump width the synchronization jump width (sjw) adjusts the bit clock as necessary by 1 ? 4 tq (as configured) to maintain synchronization with the transmitted message. synchronization is covered in more detail later in this data sheet. time quantum each of the segments that make up a bit time are made up of integer units called time quanta (tq). the length of each time quantum is based on the oscillator period (t osc ). the base tq equals twice the oscillator period. figure 5-2 shows how the bit period is derived from t osc and tq. the tq length equals one tq clock period (t brpclk ), which is programmable using a programmable prescaler, called the baud rate prescaler (brp). this is illustrated in the following equation: equation 5-2: figure 5-2: tq and the bit period ps2 min ipt 2tq == tq 2 brp t osc ?? 2brp ? f osc ------------------ - == where: brp equals the configuration as shown in register 5-1. t osc t brpclk t bit sync (fixed) propseg (programmable) ps2 (programmable) ps1 (programmable) tq (t tq ) can bit time
? 2005 microchip technology inc. preliminary ds21801d-page 39 mcp2515 5.2 synchronization to compensate for phase shifts between the oscillator frequencies of each of the nodes on the bus, each can controller must be able to synchronize to the relevant signal edge of the incoming signal. synchronization is the process by which the dpll function is implemented. when an edge in the transmitted data is detected, the logic will compare the location of the edge to the expected time (syncseg). the circuit will then adjust the values of ps1 and ps2 as necessary. there are two mechanisms used for synchronization: 1. hard synchronization. 2. resynchronization. 5.2.1 hard synchronization hard synchronization is only performed when there is a recessive-to-dominant edge during a bus idle condition, indicating the start of a message. after hard synchronization, the bit time counters are restarted with syncseg. hard synchronization forces the edge that has occurred to lie within the synchronization segment of the restarted bit time. due to the rules of synchronization, if a hard synchronization occurs, there will not be a resynchronization within that bit time. 5.2.2 resynchronization as a result of resynchronization, ps1 may be lengthened or ps2 may be shortened. the amount of lengthening or shortening of the phase buffer segments has an upper-bound, given by the synchronization jump width (sjw). the value of the sjw will be added to ps1 or subtracted from ps2 (see figure 5-3). the sjw represents the loop filtering of the dpll. the sjw is programmable between 1 tq and 4 tq. 5.2.2.1 phase errors the nrz bit coding method does not encode a clock into the message. clocking information will only be derived from recessive-to-dominant transitions. the property which states that only a fixed maximum number of successive bits have the same value (bit- stuffing) ensures resynchronization to the bit stream during a frame. the phase error of an edge is given by the position of the edge relative to syncseg, measured in tq. the phase error is defined in magnitude of tq as follows: ? e = 0 if the edge lies within syncseg. ? e > 0 if the edge lies before the sample point (tq is added to ps1). ? e < 0 if the edge lies after the sample point of the previous bit (tq is subtracted from ps2). 5.2.2.2 no phase error (e = 0) if the magnitude of the phase error is less than or equal to the programmed value of the sjw, the effect of a resynchronization is the same as that of a hard synchronization. 5.2.2.3 positive phase error (e > 0) if the magnitude of the phase error is larger than the sjw and, if the phase error is positive, ps1 is lengthened by an amount equal to the sjw. 5.2.2.4 negative phase error (e < 0) if the magnitude of the phase error is larger than the resynchronization jump width and the phase error is negative, ps2 is shortened by an amount equal to the sjw. 5.2.3 synchronization rules 1. only recessive-to-dominant edges will be used for synchronization. 2. only one synchronization within one bit time is allowed. 3. an edge will be used for synchronization only if the value detected at the previous sample point (previously read bus value) differs from the bus value immediately after the edge. 4. a transmitting node will not resynchronize on a positive phase error (e > 0). 5. if the absolute magnitude of the phase error is greater than the sjw, the appropriate phase segment will adjust by an amount equal to the sjw.
mcp2515 ds21801d-page 40 preliminary ? 2005 microchip technology inc. figure 5-3: synchronizing the bit time syncseg propseg phaseseg1 (ps1) phaseseg2 (ps2) sample point syncseg propseg phaseseg1 (ps1) phaseseg2 (ps2) sample point syncseg propseg phaseseg1 (ps1) phaseseg2 (ps2) sample point nominal bit time (nbt) sjw (ps1) sjw (ps2) nominal bit time (nbt) sjw (ps1) sjw (ps2) actual bit time resynchronization to a slower transmitter (e > 0) input signal input signal (e < 0) sjw (ps1) sjw (ps2) nominal bit time (nbt) actual bit time resynchronization to a faster transmitter (e < 0) input signal (e = 0) no resynchronization (e = 0) (e > 0)
? 2005 microchip technology inc. preliminary ds21801d-page 41 mcp2515 5.3 programming time segments some requirements for programming of the time segments: ? propseg + ps1 >= ps2 ? propseg + ps1 >= t delay ? ps2 > sjw for example, assuming that a 125 khz can baud rate with f osc = 20 mhz is desired: t osc = 50 ns, choose brp<5:0> = 04h, then t q = 500 ns. to obtain 125 khz, the bit time must be 16 t q . typically, the sampling of the bit should take place at about 60-70% of the bit time, depending on the system parameters. also, typically, the t delay is 1-2 t q . syncseg = 1 t q and propseg = 2 t q . so setting ps1 = 7 t q would place the sample at 10 t q after the transition. this would leave 6 t q for ps2. since ps2 is 6, according to the rules, sjw could be a maximum of 4 t q . however, a large sjw is typically only necessary when the clock generation of the differ- ent nodes is inaccurate or unstable, such as using ceramic resonators. so a sjw of 1 is usually enough. 5.4 oscillator tolerance the bit timing requirements allow ceramic resonators to be used in applications with transmission rates of up to 125 kbit/sec as a rule of thumb. for the full bus speed range of the can protocol, a quartz oscillator is required. a maximum node-to-node oscillator variation of 1.7% is allowed. 5.5 bit timing configuration registers the configuration registers (cnf1, cnf2, cnf3) control the bit timing for the can bus interface. these registers can only be modified when the mcp2515 is in configuration mode (see section 10.0 ?modes of operation? ). 5.5.1 cnf1 the brp<5:0> bits control the baud rate prescaler. these bits set the length of t q relative to the osc1 input frequency, with the minimum t q length being 2t osc (when brp<5:0> = ? b000000 ?). the sjw<1:0> bits select the sjw in terms of number of t q s. 5.5.2 cnf2 the prseg<2:0> bits set the length (in t q ?s) of the propagation segment. the phseg1<2:0> bits set the length (in t q ?s) of ps1. the sam bit controls how many times the rxcan pin is sampled. setting this bit to a ? 1 ? causes the bus to be sampled three times: twice at t q /2 before the sample point and once at the normal sample point (which is at the end of ps1). the value of the bus is determined to be the majority sampled. if the sam bit is set to a ? 0 ?, the rxcan pin is sampled only once at the sample point. the btlmode bit controls how the length of ps2 is determined. if this bit is set to a ? 1 ?, the length of ps2 is determined by the phseg2<2:0> bits of cnf3 (see section 5.5.3 ?cnf3? ). if the btlmode bit is set to a ? 0 ?, the length of ps2 is greater than that of ps1 and the information processing time (which is fixed at 2 t q for the mcp2515). 5.5.3 cnf3 the phseg2<2:0> bits set the length (in t q ?s) of ps2, if the cnf2.btlmode bit is set to a ? 1 ?. if the btlmode bit is set to a ? 0 ?, the phseg2<2:0> bits have no effect.
mcp2515 ds21801d-page 42 preliminary ? 2005 microchip technology inc. register 5-1: cnf1 ? configuration 1 (address: 2ah) register 5-2: cnf2 ? configuration 1 (address: 29h) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 sjw1 sjw0 brp5 brp4 brp3 brp2 brp1 brp0 bit 7 bit 0 bit 7-6 sjw : synchronization jump width length bits <1:0> 11 = length = 4 x t q 10 = length = 3 x t q 01 = length = 2 x t q 00 = length = 1 x t q bit 5-0 brp : baud rate prescaler bits <5:0> t q = 2 x (brp + 1)/f osc legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 btlmode sam phseg12 phseg11 p hseg10 prseg2 prseg1 prseg0 bit 7 bit 0 bit 7 btlmode : ps2 bit time length bit 1 = length of ps2 determined by phseg22:phseg20 bits of cnf3 0 = length of ps2 is the greater of ps1 and ipt (2 t q ) bit 6 sam : sample point configuration bit 1 = bus line is sampled three times at the sample point 0 = bus line is sampled once at the sample point bit 5-3 phseg1 : ps1 length bits<2:0> (phseg1 + 1) x t q bit 2-0 prseg : propagation segment length bits <2:0> (prseg + 1) x t q legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 43 mcp2515 register 5-3: cnf3 - configuration 1 (address: 28h) r/w-0 r/w-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 sof wakfil ? ? ? phseg22 phseg21 phseg20 bit 7 bit 0 bit 7 sof: start-of-frame signal bit if canctrl.clken = 1 : 1 = clkout pin enabled for sof signal 0 = clkout pin enabled for clockout function if canctrl.clken = 0, bit is don?t care. bit 6 wakfil : wake-up filter bit 1 = wake-up filter enabled 0 = wake-up filter disabled bit 5-3 unimplemented : reads as ?0? bit 2-0 phseg2 : ps2 length bits<2:0> (phseg2 + 1) x t q note: minimum valid setting for ps2 is 2 t q legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 44 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 45 mcp2515 6.0 error detection the can protocol provides sophisticated error detection mechanisms. the following errors can be detected. 6.1 crc error with the cyclic redundancy check (crc), the transmitter calculates special check bits for the bit sequence from the start of a frame until the end of the data field. this crc sequence is transmitted in the crc field. the receiving node also calculates the crc sequence using the same formula and performs a comparison to the received sequence. if a mismatch is detected, a crc error has occurred and an error frame is generated. the message is repeated. 6.2 acknowledge error in the acknowledge field of a message, the transmitter checks if the acknowledge slot (which has been sent out as a recessive bit) contains a dominant bit. if not, no other node has received the frame correctly. an acknowledge error has occurred, an error frame is generated and the message will have to be repeated. 6.3 form error if a node detects a dominant bit in one of the four segments (including end-of-frame, interframe space, acknowledge delimiter or crc delimiter), a form error has occurred and an error frame is generated. the message is repeated. 6.4 bit error a bit error occurs if a transmitter detects the opposite bit level to what it transmitted (i.e., transmitted a dominant and detected a recessive, or transmitted a recessive and detected a dominant). exception: in the case where the transmitter sends a recessive bit and a dominant bit is detected during the arbitration field and the acknowledge slot, no bit error is generated because normal arbitration is occurring. 6.5 stuff error lf, between the start-of-frame and the crc delimiter, six consecutive bits with the same polarity are detected, the bit-stuffing rule has been violated. a stuff error occurs and an error frame is generated. the message is repeated. 6.6 error states detected errors are made known to all other nodes via error frames. the transmission of the erroneous mes- sage is aborted and the frame is repeated as soon as possible. furthermore, each can node is in one of the three error states according to the value of the internal error counters: 1. error-active. 2. error-passive. 3. bus-off (transmitter only). the error-active state is the usual state where the node can transmit messages and active error frames (made of dominant bits) without any restrictions. in the error-passive state, messages and passive error frames (made of recessive bits) may be transmitted. the bus-off state makes it temporarily impossible for the station to participate in the bus communication. during this state, messages can neither be received or transmitted. only transmitters can go bus-off. 6.7 error modes and error counters the mcp2515 contains two error counters: the receive error counter (rec) (see register 6-2) and the transmit error counter (tec) (see register 6-1). the values of both counters can be read by the mcu. these counters are incremented/decremented in accordance with the can bus specification. the mcp2515 is error-active if both error counters are below the error-passive limit of 128. it is error-passive if at least one of the error counters equals or exceeds 128. it goes to bus-off if the tec exceeds the bus-off limit of 255. the device remains in this state until the bus-off recovery sequence is received. the bus-off recovery sequence consists of 128 occurrences and 11 consec- utive recessive bits (see figure 6-1). the current error mode of the mcp2515 can be read by the mcu via the eflg register (see register 6-3). additionally, there is an error state warning flag bit (eflg:ewarn) which is set if at least one of the error counters equals or exceeds the error warning limit of 96. ewarn is reset if both error counters are less than the error warning limit. note: the mcp2515, after going bus-off, will recover back to error-active without any intervention by the mcu if the bus remains idle for 128 x 11 bit times. if this is not desired, the error interrupt service routine should address this.
mcp2515 ds21801d-page 46 preliminary ? 2005 microchip technology inc. figure 6-1: error modes state diagram register 6-1: tec ? transmit error counter (address: 1ch) register 6-2: rec ? receiver error counter (address: 1dh) r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 tec7 tec6 tec5 tec4 tec3 tec2 tec1 tec0 bit 7 bit 0 bit 7-0 tec : transmit error count bits <7:0> legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown r-0 r-0 r-0 r-0 r-0 r-0 r-0 r-0 rec7 rec6 rec5 rec4 rec3 rec2 rec1 rec0 bit 7 bit 0 bit 7-0 rec : receive error count bits <7:0> legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown bus-off error-active error-passive rec < 127 or tec < 127 rec > 127 or tec > 127 tec > 255 reset 128 occurrences of 11 consecutive ?recessive? bits
? 2005 microchip technology inc. preliminary ds21801d-page 47 mcp2515 register 6-3: eflg ? error flag (address: 2dh) r/w-0 r/w-0 r-0 r-0 r-0 r-0 r-0 r-0 rx1ovr rx0ovr txbo txep rxep txwar rxwar ewarn bit 7 bit 0 bit 7 rx1ovr : receive buffer 1 overflow flag bit - set when a valid message is received for rxb1 and canintf.rx1if = 1 - must be reset by mcu bit 6 rx0ovr : receive buffer 0 overflow flag bit - set when a valid message is received for rxb0 and canintf.rx0if = 1 - must be reset by mcu bit 5 txbo : bus-off error flag bit - bit set when tec reaches 255 - reset after a successful bus recovery sequence bit 4 txep : transmit error-passive flag bit - set when tec is equal to or greater than 128 - reset when tec is less than 128 bit 3 rxep : receive error-passive flag bit - set when rec is equal to or greater than 128 - reset when rec is less than 128 bit 2 txwar : transmit error warning flag bit - set when tec is equal to or greater than 96 - reset when tec is less than 96 bit 1 rxwar : receive error warning flag bit - set when rec is equal to or greater than 96 - reset when rec is less than 96 bit 0 ewarn : error warning flag bit - set when tec or rec is equal to or greater than 96 (txwar or rxwar = 1 ) - reset when both rec and tec are less than 96 legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 48 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 49 mcp2515 7.0 interrupts the mcp2515 has eight sources of interrupts. the caninte register contains the individual interrupt enable bits for each interrupt source. the canintf register contains the corresponding interrupt flag bit for each interrupt source. when an interrupt occurs, the int pin is driven low by the mcp2515 and will remain low until the interrupt is cleared by the mcu. an interrupt can not be cleared if the respective condition still prevails. it is recommended that the bit modify command be used to reset flag bits in the canintf register rather than normal write operations. this is done to prevent unintentionally changing a flag that changes during the write command, potentially causing an interrupt to be missed. it should be noted that the canintf flags are read/write and an interrupt can be generated by the mcu setting any of these bits, provided the associated caninte bit is also set. 7.1 interrupt code bits the source of a pending interrupt is indicated in the canstat.icod (interrupt code) bits, as indicated in register 10-2. in the event that multiple interrupts occur, the int will remain low until all interrupts have been reset by the mcu. the canstat.icod bits will reflect the code for the highest priority interrupt that is currently pending. interrupts are internally prioritized such that the lower the icod value, the higher the interrupt priority. once the highest priority interrupt condition has been cleared, the code for the next highest priority interrupt that is pending (if any) will be reflected by the icod bits (see table 7-1). only those interrupt sources that have their associated caninte enable bit set will be reflected in the icod bits. table 7-1: icod<2:0> decode 7.2 transmit interrupt when the transmit interrupt is enabled (caninte.txnie = 1 ), an interrupt will be generated on the int pin once the associated transmit buffer becomes empty and is ready to be loaded with a new message. the canintf.txnif bit will be set to indicate the source of the interrupt. the interrupt is cleared by clearing the txnif bit. 7.3 receive interrupt when the receive interrupt is enabled (caninte.rxnie = 1 ), an interrupt will be generated on the int pin once a message has been successfully received and loaded into the associated receive buffer. this interrupt is activated immediately after receiving the eof field. the canintf.rxnif bit will be set to indicate the source of the interrupt. the interrupt is cleared by clearing the rxnif bit. 7.4 message error interrupt when an error occurs during the transmission or reception of a message, the message error flag (canintf.merrf) will be set and, if the caninte.merre bit is set, an interrupt will be gener- ated on the int pin. this is intended to be used to facilitate baud rate determination when used in conjunction with listen-only mode. 7.5 bus activity wakeup interrupt when the mcp2515 is in sleep mode and the bus activ- ity wakeup interrupt is enabled (caninte.wakie = 1 ), an interrupt will be generated on the int pin and the canintf.wakif bit will be set when activity is detected on the can bus. this interrupt causes the mcp2515 to exit sleep mode. the interrupt is reset by clearing the wakif bit. 7.6 error interrupt when the error interrupt is enabled (caninte.errie = 1 ), an interrupt is generated on the int pin if an overflow condition occurs or if the error state of the transmitter or receiver has changed. the error flag (eflg) register will indicate one of the following conditions. 7.6.1 receiver overflow an overflow condition occurs when the mab has assembled a valid receive message (the message meets the criteria of the acceptance filters) and the receive buffer associated with the filter is not available for loading of a new message. the associated eflg.rxnovr bit will be set to indicate the overflow condition. this bit must be cleared by the mcu. icod<2:0> boolean expression 000 err ?wak ?tx0 ?tx1 ?tx2 ?rx0 ?rx1 001 err 010 err ?wak 011 err ?wak ?tx0 100 err ?wak ?tx0 ?tx1 101 err ?wak ?tx0 ?tx1 ?tx2 110 err ?wak ?tx0 ?tx1 ?tx2 ?rx0 111 err ?wak ?tx0 ?tx1 ?tx2 ?rx0 ?rx1 note: err is associated with caninte,errie. note: the mcp2515 wakes up into listen-only mode.
mcp2515 ds21801d-page 50 preliminary ? 2005 microchip technology inc. 7.6.2 receiver warning the rec has reached the mcu warning limit of 96. 7.6.3 transmitter warning the tec has reached the mcu warning limit of 96. 7.6.4 receiver error-passive the rec has exceeded the error-passive limit of 127 and the device has gone to error-passive state. 7.6.5 transmitter error-passive the tec has exceeded the error- passive limit of 127 and the device has gone to error- passive state. 7.6.6 bus-off the tec has exceeded 255 and the device has gone to bus-off state. 7.7 interrupt acknowledge interrupts are directly associated with one or more sta- tus flags in the canintf register. interrupts are pend- ing as long as one of the flags is set. once an interrupt flag is set by the device, the flag can not be reset by the mcu until the interrupt condition is removed. register 7-1: caninte ? interrupt enable (address: 2bh) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 merre wakie errie tx2ie tx1ie tx0ie rx1ie rx0ie bit 7 bit 0 bit 7 merre : message error interrupt enable bit 1 = interrupt on error during message reception or transmission 0 =disabled bit 6 wakie : wakeup interrupt enable bit 1 = interrupt on can bus activity 0 =disabled bit 5 errie : error interrupt enable bit (multiple sources in eflg register) 1 = interrupt on eflg error condition change 0 =disabled bit 4 tx2ie : transmit buffer 2 empty interrupt enable bit 1 = interrupt on txb2 becoming empty 0 =disabled bit 3 tx1ie : transmit buffer 1 empty interrupt enable bit 1 = interrupt on txb1 becoming empty 0 =disabled bit 2 tx0ie : transmit buffer 0 empty interrupt enable bit 1 = interrupt on txb0 becoming empty 0 =disabled bit 1 rx1ie : receive buffer 1 full interrupt enable bit 1 = interrupt when message received in rxb1 0 =disabled bit 0 rx0ie : receive buffer 0 full interrupt enable bit 1 = interrupt when message received in rxb0 0 =disabled legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 51 mcp2515 register 7-2: canintf ? interrupt flag (address: 2ch) r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 merrf wakif errif tx2if tx1if tx0if rx1if rx0if bit 7 bit 0 bit 7 merrf : message error interrupt flag bit 1 = interrupt pending (must be cleared by mcu to reset interrupt condition) 0 = no interrupt pending bit 6 wakif : wakeup interrupt flag bit 1 = interrupt pending (must be cleared by mcu to reset interrupt condition) 0 = no interrupt pending bit 5 errif : error interrupt flag bit (multiple sources in eflg register) 1 = interrupt pending (must be cleared by mcu to reset interrupt condition) 0 = no interrupt pending bit 4 tx2if : transmit buffer 2 empty interrupt flag bit 1 = interrupt pending (must be cleared by mcu to reset interrupt condition) 0 = no interrupt pending bit 3 tx1if : transmit buffer 1 empty interrupt flag bit 1 = interrupt pending (must be cleared by mcu to reset interrupt condition) 0 = no interrupt pending bit 2 tx0if : transmit buffer 0 empty interrupt flag bit 1 = interrupt pending (must be cleared by mcu to reset interrupt condition) 0 = no interrupt pending bit 1 rx1if : receive buffer 1 full interrupt flag bit 1 = interrupt pending (must be cleared by mcu to reset interrupt condition) 0 = no interrupt pending bit 0 rx0if : receive buffer 0 full interrupt flag bit 1 = interrupt pending (must be cleared by mcu to reset interrupt condition) 0 = no interrupt pending legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 52 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 53 mcp2515 8.0 oscillator the mcp2515 is designed to be operated with a crystal or ceramic resonator connected to the osc1 and osc2 pins. the mcp2515 oscillator design requires the use of a parallel cut crystal. use of a series cut crystal may give a frequency out of the crystal manufacturers specifications. a typical oscillator circuit is shown in figure 8-1. the mcp2515 may also be driven by an external clock source connected to the osc1 pin, as shown in figure 8-2 and figure 8-3. 8.1 oscillator startup timer the mcp2515 utilizes an oscillator startup timer (ost) that holds the mcp2515 in reset to ensure that the oscillator has stabilized before the internal state machine begins to operate. the ost maintains reset for the first 128 osc1 clock cycles after power-up or a wake-up from sleep mode occurs. it should be noted that no spi protocol operations should be attempted until after the ost has expired. 8.2 clkout pin the clkout pin is provided to the system designer for use as the main system clock or as a clock input for other devices in the system. the clkout has an inter- nal prescaler which can divide f osc by 1, 2, 4 and 8. the clkout function is enabled and the prescaler is selected via the cancntrl register (see register 10-1). the clkout pin will be active upon system reset and default to the slowest speed (divide by 8) so that it can be used as the mcu clock. when sleep mode is requested, the mcp2515 will drive sixteen additional clock cycles on the clkout pin before entering sleep mode. the idle state of the clkout pin in sleep mode is low. when the clkout function is disabled (cancntrl.clken = ? 0 ?) the clkout pin is in a high-impedance state. the clkout function is designed to ensure that t hclkout and t lclkout timings are preserved when the clkout pin function is enabled, disabled or the prescaler value is changed. figure 8-1: crystal/ceramic resonator operation figure 8-2: external clock source note: the maximum frequency on clkout is specified as 25 mhz (see table 13-5) c 1 c 2 xtal osc2 r s (1) osc1 r f (2) sleep to internal logic note 1: a series resistor (r s ) may be required for at strip cut crystals. 2: the feedback resistor (r f ), is typically in the range of 2 to 10 m . clock from external system osc1 osc2 open (1) note 1: a resistor to ground may be used to reduce system noise. this may increase system current. 2: duty cycle restrictions must be observed (see table 12-2).
mcp2515 ds21801d-page 54 preliminary ? 2005 microchip technology inc. figure 8-3: external series resonant crystal oscillator circuit (1) table 8-1: capacitor selection for ceramic resonators table 8-2: capacitor selection for crystal oscillator 330 k 74as04 74as04 mcp2510 osc1 to other devices xtal 330 k 74as04 0.1 mf note 1: duty cycle restrictions must be observed (see table 12-2). typical capacitor values used: mode freq. osc1 osc2 hs 8.0 mhz 27 pf 27 pf 16.0 mhz 22 pf 22 pf capacitor values are for design guidance only: these capacitors were tested with the resonators listed below for basic start-up and operation. these values are not optimized. different capacitor values may be required to produce acceptable oscillator operation. the user should test the performance of the oscillator over the expected v dd and temperature range for the application. see the notes following table 8-2 for additional infor- mation. resonators used: 4.0 mhz 8.0 mhz 16.0 mhz osc type (1)(4) crystal freq. (2) typical capacitor values tested: c1 c2 hs 4 mhz 27 pf 27 pf 8 mhz 22 pf 22 pf 20mhz 15pf 15pf capacitor values are for design guidance only: these capacitors were tested with the crystals listed below for basic start-up and operation. these values are not optimized. different capacitor values may be required to produce acceptable oscillator operation. the user should test the performance of the oscillator over the expected v dd and temperature range for the application. see the notes following this table for additional information. crystals used (3) : 4.0 mhz 8.0 mhz 20.0 mhz note 1: while higher capacitance increases the stability of the oscillator, it also increases the start-up time. 2: since each resonator/crystal has its own characteristics, the user should consult the resonator/crystal manufacturer for appropriate values of external components. 3: r s may be required to avoid overdriving crystals with low drive level specification. 4: always verify oscillator performance over the v dd and temperature range that is expected for the application.
? 2005 microchip technology inc. preliminary ds21801d-page 55 mcp2515 9.0 reset the mcp2515 differentiates between two resets: 1. hardware reset ? low on reset pin. 2. spi reset ? reset via spi command. both of these resets are functionally equivalent. it is important to provide one of these two resets after power-up to ensure that the logic and registers are in their default state. a hardware reset can be achieved automatically by placing an rc on the reset pin. (see figure 9-1). the values must be such that the device is held in reset for a minimum of 2 s after v dd reaches operating voltage, as indicated in the electrical specification (t rl ). figure 9-1: res et pin configuration example reset r1 (2) v dd v dd r c d (1) note 1: the diode d helps discharge the capacitor quickly when v dd powers down. 2: r1 = 1 k to 10 k will limit any current flowing into reset from external capacitor c, in the event of reset pin breakdown due to electrostatic discharge (esd) or electrical overstress (eos).
mcp2515 ds21801d-page 56 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 57 mcp2515 10.0 modes of operation the mcp2515 has five modes of operation. these modes are: 1. configuration mode. 2. normal mode. 3. sleep mode. 4. listen-only mode. 5. loopback mode. the operational mode is selected via the canctrl. reqop bits (see register 10-1). when changing modes, the mode will not actually change until all pending message transmissions are complete. the requested mode must be verified by reading the canstat.opmode bits (see register 10-2). 10.1 configuration mode the mcp2515 must be initialized before activation. this is only possible if the device is in the configuration mode. configuration mode is automatically selected after power-up, a reset or can be entered from any other mode by setting the cantrl.reqop bits to ? 100 ?. when configuration mode is entered, all error counters are cleared. configuration mode is the only mode where the following registers are modifiable: ? cnf1, cnf2, cnf3 ? txrtsctrl ? filter registers ? mask registers 10.2 sleep mode the mcp2515 has an internal sleep mode that is used to minimize the current consumption of the device. the spi interface remains active for reading even when the mcp2515 is in sleep mode, allowing access to all registers. to enter sleep mode, the mode request bits are set in the canctrl register (reqop<2:0>). the canstat.opmode bits indicate operation mode. these bits should be read after sending the sleep command to the mcp2515. the mcp2515 is active and has not yet entered sleep mode until these bits indicate that sleep mode has been entered. when in internal sleep mode, the wake-up interrupt is still active (if enabled). this is done so that the mcu can also be placed into a sleep mode and use the mcp2515 to wake it up upon detecting activity on the bus. when in sleep mode, the mcp2515 stops its internal oscillator. the mcp2515 will wake-up when bus activity occurs or when the mcu sets, via the spi interface, the canintf.wakif bit to ?generate? a wake-up attempt (the caninte.wakie bit must also be set in order for the wake-up interrupt to occur). the txcan pin will remain in the recessive state while the mcp2515 is in sleep mode. 10.2.1 wake-up functions the device will monitor the rxcan pin for activity while it is in sleep mode. if the caninte.wakie bit is set, the device will wake up and generate an interrupt. since the internal oscillator is shut down while in sleep mode, it will take some amount of time for the oscillator to start up and the device to enable itself to receive messages. this oscillator start-up timer (ost) is defined as 128 t osc . the device will ignore the message that caused the wake-up from sleep mode, as well as any messages that occur while the device is ?waking up?. the device will wake up in listen-only mode. the mcu must set normal mode before the mcp2515 will be able to communicate on the bus. the device can be programmed to apply a low-pass filter function to the rxcan input line while in internal sleep mode. this feature can be used to prevent the device from waking up due to short glitches on the can bus lines. the cnf3.wakfil bit enables or disables the filter. 10.3 listen-only mode listen-only mode provides a means for the mcp2515 to receive all messages (including messages with errors) by configuring the rxbnctrl.rxm<1:0> bits. this mode can be used for bus monitor applications or for detecting the baud rate in ?hot plugging? situations. for auto-baud detection, it is necessary that there are at least two other nodes that are communicating with each other. the baud rate can be detected empirically by testing different values until valid messages are received. listen-only mode is a silent mode, meaning no messages will be transmitted while in this mode (including error flags or acknowledge signals). the filters and masks can be used to allow only particular messages to be loaded into the receive registers, or the masks can be set to all zeros to allow a message with any identifier to pass. the error counters are reset and deactivated in this state. the listen-only mode is activated by setting the mode request bits in the canctrl register.
mcp2515 ds21801d-page 58 preliminary ? 2005 microchip technology inc. 10.4 loopback mode loopback mode will allow internal transmission of messages from the transmit buffers to the receive buffers without actually transmitting messages on the can bus. this mode can be used in system development and testing. in this mode, the ack bit is ignored and the device will allow incoming messages from itself just as if they were coming from another node. the loopback mode is a silent mode, meaning no messages will be transmitted while in this state (including error flags or acknowledge signals). the txcan pin will be in a recessive state. the filters and masks can be used to allow only particular messages to be loaded into the receive registers. the masks can be set to all zeros to provide a mode that accepts all messages. the loopback mode is activated by setting the mode request bits in the canctrl register. 10.5 normal mode normal mode is the standard operating mode of the mcp2515. in this mode, the device actively monitors all bus messages and generates acknowledge bits, error frames, etc. this is also the only mode in which the mcp2515 will transmit messages over the can bus. register 10-1: canctrl ? can control register (address: xfh) r/w-1 r/w-0 r/w-0 r/w-0 r/w-0 r/w-1 r/w-1 r/w-1 reqop2 reqop1 reqop0 abat osm clken clkpre1 clkpre0 bit 7 bit 0 bit 7-5 reqop: request operation mode bits <2:0> 000 = set normal operation mode 001 = set sleep mode 010 = set loopback mode 011 = set listen-only mode 100 = set configuration mode all other values for reqop bits are invalid and should not be used note: on power-up, reqop = b?111? bit 4 abat: abort all pending transmissions bit 1 = request abort of all pending transmit buffers 0 = terminate request to abort all transmissions bit 3 osm: one shot mode bit 1 = enabled. message will only attempt to transmit one time 0 = disabled. messages will reattempt transmission, if required bit 2 clken: clkout pin enable bit 1 = clkout pin enabled 0 = clkout pin disabled (pin is in high-impedance state) bit 1-0 clkpre: clkout pin prescaler bits <1:0> 00 =f clkout = system clock/1 01 =f clkout = system clock/2 10 =f clkout = system clock/4 11 =f clkout = system clock/8 legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
? 2005 microchip technology inc. preliminary ds21801d-page 59 mcp2515 register 10-2: canstat ? can status register (address: xeh) r-1 r-0 r-0 u-0 r-0 r-0 r-0 u-0 opmod2 opmod1 opmod0 ? icod2 icod1 icod0 ? bit 7 bit 0 bit 7-5 opmod : operation mode bits <2:0> 000 = device is in the normal operation mode 001 = device is in sleep mode 010 = device is in loopback mode 011 = device is in listen-only mode 100 = device is in configuration mode bit 4 unimplemented: read as ? 0 ? bit 3-1 icod : interrupt flag code bits <2:0> 000 = no interrupt 001 = error interrupt 010 = wake-up interrupt 011 = txb0 interrupt 100 = txb1 interrupt 101 = txb2 interrupt 110 = rxb0 interrupt 111 = rxb1 interrupt bit 0 unimplemented: read as ? 0 ? legend: r = readable bit w = writable bit u = unimplemented bit, read as ? 0 ? -n = value at por ? 1 ? = bit is set ? 0 ? = bit is cleared x = bit is unknown
mcp2515 ds21801d-page 60 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 61 mcp2515 11.0 register map the register map for the mcp2515 is shown in table 11-1. address locations for each register are determined by using the column (higher-order 4 bits) and row (lower-order 4 bits) values. the registers have been arranged to optimize the sequential reading and writing of data. some specific control and status registers allow individual bit modification using the spi bit modify command. the registers that allow this command are shown as shaded locations in table 11-1. a summary of the mcp2515 control registers is shown in table 11-2. table 11-1: can controller register map table 11-2: control register summary lower address bits higher-order address bits 0000 xxxx 0001 xxxx 0010 xxxx 0011 xxxx 0100 xxxx 0101 xxxx 0110 xxxx 0111 xxxx 0000 rxf0sidh rxf3sidh rxm0sidh txb0ctrl txb1ctrl txb2ctrl rxb0ctrl rxb1ctrl 0001 rxf0sidl rxf3sidl rxm0sidl txb0sidh txb1sidh txb2sidh rxb0sidh rxb1sidh 0010 rxf0eid8 rxf3eid8 rxm0eid8 txb0sidl txb1sidl txb2sidl rxb0sidl rxb1sidl 0011 rxf0eid0 rxf3eid0 rxm0eid0 txb0eid8 txb1eid8 txb2eid8 rxb0eid8 rxb1eid8 0100 rxf1sidh rxf4sidh rxm1sidh txb0eid0 txb1eid0 txb2eid0 rxb0eid0 rxb1eid0 0101 rxf1sidl rxf4sidl rxm1sidl txb0dlc txb1dlc txb2dlc rxb0dlc rxb1dlc 0110 rxf1eid8 rxf4eid8 rxm1eid8 txb0d0 txb1d0 txb2d0 rxb0d0 rxb1d0 0111 rxf1eid0 rxf4eid0 rxm1eid0 txb0d1 txb1d1 txb2d1 rxb0d1 rxb1d1 1000 rxf2sidh rxf5sidh cnf3 txb0d2 txb1d2 txb2d2 rxb0d2 rxb1d2 1001 rxf2sidl rxf5sidl cnf2 txb0d3 txb1d3 txb2d3 rxb0d3 rxb1d3 1010 rxf2eid8 rxf5eid8 cnf1 txb0d4 txb1d4 txb2d4 rxb0d4 rxb1d4 1011 rxf2eid0 rxf5eid0 caninte txb0d5 txb1d5 txb2d5 rxb0d5 rxb1d5 1100 bfpctrl tec canintf txb0d6 txb1d6 txb2d6 rxb0d6 rxb1d6 1101 txrtsctrl rec eflg txb0d7 txb1d7 txb2d7 rxb0d7 rxb1d7 1110 canstat canstat canstat canstat canstat canstat canstat canstat 1111 canctrl canctrl canctrl canctrl canctrl canctrl canctrl canctrl note: shaded register locations indicate that these allow the user to manipulate individual bits using the bit modify command. register name address (hex) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 por/rst value bfpctrl 0c ? ? b1bfs b0bfs b1bfe b0bfe b1bfm b0bfm --00 0000 txrtsctrl 0d ? ? b2rts b1rts b0rts b2rtsm b1rtsm b0rtsm --xx x000 canstat xe opmod2 opmod1 opmod0 ? icod2 icod1 icod0 ? 100- 000- canctrl xf reqop2 reqop1 reqop0 abat osm clken clkpre1 clkpre0 1110 0111 tec 1c transmit error counter (tec) 0000 0000 rec 1d receive error counter (rec) 0000 0000 cnf3 28 sof wakfil ? ? ? phseg22 phseg21 phseg20 00-- -000 cnf2 29 btlmode sam phseg12 phseg11 phseg10 prseg2 prseg1 prseg0 0000 0000 cnf1 2a sjw1 sjw0 brp5 brp4 brp3 brp2 brp1 brp0 0000 0000 caninte 2b merre wakie errie tx2ie tx1ie tx0ie rx1ie rx0ie 0000 0000 canintf 2c merrf wakif errif tx2if tx1if tx0if rx1if rx0if 0000 0000 eflg 2d rx1ovr rx0ovr txbo txep rxep txwar rxwar ewarn 0000 0000 txb0ctrl 30 ? abtf mloa txerr txreq ? txp1 txp0 -000 0-00 txb1ctrl 40 ? abtf mloa txerr txreq ? txp1 txp0 -000 0-00 txb2ctrl 50 ? abtf mloa txerr txreq ? txp1 txp0 -000 0-00 rxb0ctrl 60 ? rxm1 rxm0 ? rxrtr bukt bukt filhit0 -00- 0000 rxb1ctrl 70 ? rsm1 rxm0 ? rxrtr filhit2 filhit1 filhit0 -00- 0000
mcp2515 ds21801d-page 62 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 63 mcp2515 12.0 spi? interface 12.1 overview the mcp2515 is designed to interface directly with the serial peripheral interface (spi) port available on many microcontrollers and supports mode 0,0 and mode 1,1. commands and data are sent to the device via the si pin, with data being clocked in on the rising edge of sck. data is driven out by the mcp2515 (on the so line) on the falling edge of sck. the cs pin must be held low while any operation is performed. table 12-1 shows the instruction bytes for all operations. refer to figure 12-10 and figure 12-11 for detailed input and output timing diagrams for both mode 0,0 and mode 1,1 operation. 12.2 reset instruction the reset instruction can be used to re-initialize the internal registers of the mcp2515 and set configuration mode. this command provides the same functionality, via the spi interface, as the reset pin. the reset instruction is a single-byte instruction that requires selecting the device by pulling cs low, sending the instruction byte and then raising cs . it is highly recommended that the reset command be sent (or the reset pin be lowered) as part of the power-on initialization sequence. 12.3 read instruction the read instruction is started by lowering the cs pin. the read instruction is then sent to the mcp2515 followed by the 8-bit address (a7 through a0). next, the data stored in the register at the selected address will be shifted out on the so pin. the internal address pointer is automatically incremented to the next address once each byte of data is shifted out. therefore, it is possible to read the next consecutive register address by continuing to pro- vide clock pulses. any number of consecutive register locations can be read sequentially using this method. the read operation is terminated by raising the cs pin (figure 12-2). 12.4 read rx buffer instruction the read rx buffer instruction (figure 12-3) provides a means to quickly address a receive buffer for reading. this instruction reduces the spi overhead by one byte, the address byte. the command byte actually has four possible values that determine the address pointer location. once the command byte is sent, the controller clocks out the data at the address location the same as the read instruction (i.e., sequential reads are possible). this instruction further reduces the spi overhead by automatically clearing the associated receive flag (canintf.rxnif) when cs is raised at the end of the command. 12.5 write instruction the write instruction is started by lowering the cs pin. the write instruction is then sent to the mcp2515 followed by the address and at least one byte of data. it is possible to write to sequential registers by continuing to clock in data bytes, as long as cs is held low. data will actually be written to the register on the rising edge of the sck line for the d0 bit. if the cs line is brought high before eight bits are loaded, the write will be aborted for that data byte and previous bytes in the command will have been written. refer to the timing diagram in figure 12-4 for a more detailed illustration of the byte write sequence. 12.6 load tx buffer instruction the load tx buffer instruction (figure 12-5) eliminates the eight-bit address required by a normal write command. the eight-bit instruction sets the address pointer to one of six addresses to quickly write to a transmit buffer that points to the ?id? or ?data? address of any of the three transmit buffers. 12.7 request-to-send (rts) instruction the rts command can be used to initiate message transmission for one or more of the transmit buffers. the mcp2515 is selected by lowering the cs pin. the rts command byte is then sent. shown in figure 12-6, the last 3 bits of this command indicate which transmit buffer(s) are enabled to send. this command will set the txbnctrl.txreq bit for the respective buffer(s). any or all of the last three bits can be set in a single command. if the rts command is sent with nnn = 000 , the command will be ignored. 12.8 read status instruction the read status instruction allows single instruction access to some of the often used status bits for message reception and transmission. the mcp2515 is selected by lowering the cs pin and the read status command byte, shown in figure 12-8, is sent to the mcp2515. once the command byte is sent, the mcp2515 will return eight bits of data that contain the status. if additional clocks are sent after the first eight bits are transmitted, the mcp2515 will continue to output the status bits as long as the cs pin is held low and clocks are provided on sck. note: the mcp2515 expects the first byte after lowering cs to be the instruction/command byte. this implies that cs must be raised and then lowered again to invoke another command.
mcp2515 ds21801d-page 64 preliminary ? 2005 microchip technology inc. each status bit returned in this command may also be read by using the standard read command with the appropriate register address. 12.9 rx status instruction the rx status instruction (figure 12-9) is used to quickly determine which filter matched the message and message type (standard, extended, remote). after the command byte is sent, the controller will return 8 bits of data that contain the status data. if more clocks are sent after the 8 bits are transmitted, the controller will continue to output the same status bits as long as the cs pin stays low and clocks are provided. 12.10 bit modify instruction the bit modify instruction provides a means for setting or clearing individual bits in specific status and control registers. this command is not available for all registers. see section 11.0 ?register map? to determine which registers allow the use of this command. the part is selected by lowering the cs pin and the bit modify command byte is then sent to the mcp2515. the command is followed by the address of the register, the mask byte and finally the data byte. the mask byte determines which bits in the register will be allowed to change. a ? 1 ? in the mask byte will allow a bit in the register to change, while a ? 0 ? will not. the data byte determines what value the modified bits in the register will be changed to. a ? 1 ? in the data byte will set the bit and a ? 0 ? will clear the bit, provided that the mask for that bit is set to a ? 1 ? (see figure 12-7). figure 12-1: bit modify table 12-1: spi? instruction set note: executing the bit modify command on registers that are not bit-modifiable will force the mask to ffh. this will allow byte- writes to the registers, not bit modify. mask byte data byte previous register contents resulting register contents 001 1 11 00 xx1 1 00 xx 010 1 10 00 011 1 00 00 instruction name instruction format description reset 1100 0000 resets internal registers to default state, set configuration mode. read 0000 0011 read data from register beginning at selected address. read rx buffer 1001 0nm0 when reading a receive buffer, reduces the overhead of a normal read command by placing the address pointer at one of four locations, as indicated by ?n,m?. note: the associated rx flag bit (canintf.rxnif) will be cleared after bringing cs high. write 0000 0010 write data to register beginning at selected address. load tx buffer 0100 0abc when loading a transmit buffer, reduces the overhead of a normal write command by placing the address pointer at one of six locations as indicated by ?a,b,c?. rts (message request-to-send) 1000 0nnn instructs controller to begin message transmission sequence for any of the transmit buffers. read status 1010 0000 quick polling command that reads several status bits for transmit and receive functions. rx status 1011 0000 quick polling command that indicates filter match and message type (standard, extended and/or remote) of received message. bit modify 0000 0101 allows the user to set or clear individual bits in a particular register. note: not all registers can be bit-modified with this command. executing this command on registers that are not bit- modifiable will force the mask to ffh. see the register map in section 11.0 ?register map? for a list of the registers that apply. 1000 0nnn request-to-send for txbo request-to-send for txb1 request-to-send for txb2
? 2005 microchip technology inc. preliminary ds21801d-page 65 mcp2515 figure 12-2: read instruction figure 12-3: read rx buffer instruction figure 12-4: byte write instruction so si sck cs 0 23456789101112131415161718192021 22 1 01 0 0 0 0 01 a7 6 5 4 1a0 76543210 instruction address byte data out high-impedance 23 32 don?t care so si sck cs 0 23456789101112131415 1 m n 76543210 instruction data out high-impedance don?t care n m address points to address 00 receive buffer 0, start at rxb0sidh 0x61 01 receive buffer 0, start at rxb0d0 0x66 10 receive buffer 1, start at rxb1sidh 0x71 11 receive buffer 1, start at rxb1d0 0x76 0 0 1 0 0 1 so si sck cs 0 23456789101112131415161718192021 22 1 00 0 0 0 0 0 a7 6 5 4 1a0 76543210 instruction high-impedance 23 32 1 address byte data byte
mcp2515 ds21801d-page 66 preliminary ? 2005 microchip technology inc. figure 12-5: load tx buffer figure 12-6: request-to-send (rts) instruction figure 12-7: bit modify instruction so si sck cs 0 23456789101112131415 1 ac 0 0 0 1 0b 76543210 instruction data in high-impedance a b c address points to addr 000 tx buffer 0, start at txb0sidh 0x31 001 tx buffer 0, start at txb0d0 0x36 010 tx buffer 1, start at txb1sidh 0x41 011 tx buffer 1, start at txb1d0 0x46 100 tx buffer 2, start at txb2sidh 0x51 101 tx buffer 2, start at txb2d0 0x56 so si sck cs 0 234567 1 t2 t0 0 0 0 0 1 instruction high-impedance t1 so si sck cs 0 2 3 4 5 6 7 8 9 101112131415161718192021 22 1 11 0 0 0 0 0 a7 6 5 4 1 a0 76543210 instruction high-impedance 32 0 address byte mask byte 76543210 23 24 25 26 27 28 29 30 31 data byte note: not all registers can be accessed with this command. see the register map for a list of the registers that apply.
? 2005 microchip technology inc. preliminary ds21801d-page 67 mcp2515 figure 12-8: read status instruction figure 12-9: rx status instruction so si sck cs 0 23456789101112131415161718192021 22 1 00 0 0 1 0 10 76543210 instruction data out high-impedance 23 don?t care canintf.rx0if canintfl.rx1if canintf.tx0if canintf.tx1if canintf.tx2if txb2cntrl.txreq txb1cntrl.txreq txb0cntrl.txreq 76543210 data out repeat so si sck cs 0 23456789101112131415161718192021 22 1 00 0 1 1 0 10 76543210 instruction data out high-impedance 23 don?t care 76543210 data out repeat 2 1 0 filter match 000 rxf0 001 rxf1 010 rxf2 011 rxf3 100 rxf4 101 rxf5 110 rxf0 (rollover to rxb1) 111 rxf1 (rollover to rxb1) canintf.rxnif bits are mapped to bits 7 and 6. 7 6 received message 00 no rx message 01 message in rxb0 10 message in rxb1 11 messages in both buffers* the extended id bit is mapped to bit 4. the rtr bit is mapped to bit 3. 4 3 msg type received 00 standard data frame 01 standard remote frame 10 extended data frame 11 extended remote frame * buffer 0 has higher priority, therefore, rxb0 status is reflected in bits 4:0.
mcp2515 ds21801d-page 68 preliminary ? 2005 microchip technology inc. figure 12-10: spi? input timing figure 12-11: spi? output timing cs sck si so 1 5 4 7 6 3 10 2 lsb in msb in high-impedance 11 mode 1,1 mode 0,0 cs sck so 8 13 msb out lsb out 2 14 don?t care si mode 1,1 mode 0,0 9 12
? 2005 microchip technology inc. preliminary ds21801d-page 69 mcp2515 13.0 electrical characteristics 13.1 absolute maximum ratings ? v dd ............................................................................................................................... ..............................................7.0v all inputs and outputs w.r.t. v ss ..........................................................................................................-0.6v to v dd +1.0v storage temperature ............................................................................................................ ...................-65c to +150c ambient temp. with power applied ............................................................................................... ...........-65c to +125c soldering temperature of leads (10 seconds) .................................................................................... ................... +300c ? notice: stresses above those listed under ?maximum ratings? may cause permanent damage to the device. this is a stress rating only and functional operation of the device at those or any other conditions above those indicated in the operational listings of this specification is not implied. exposure to maximum rating conditions for extended periods may affect device reliability.
mcp2515 ds21801d-page 70 preliminary ? 2005 microchip technology inc. table 13-1: dc characteristics dc characteristics industrial (i): t amb = -40c to +85c v dd = 2.7v to 5.5v extended (e): t amb = -40c to +125c v dd = 4.5v to 5.5v param. no. sym characteristic min max units conditions v dd supply voltage 2.7 5.5 v v ret register retention voltage 2.4 ? v high-level input voltage v ih rxcan 2 v dd + 1 v sck, cs , si, txnrts pins 0.7 v dd v dd + 1 v osc1 0.85 v dd v dd v reset 0.85 v dd v dd v low-level input voltage v il rxcan, txnrts pins -0.3 .15 v dd v sck, cs , si -0.3 0.4 v osc1 v ss .3 v dd v reset v ss .15 v dd v low-level output voltage v ol txcan ? 0.6 v i ol = +6.0 ma, v dd = 4.5v rxnbf pins ? 0.6 v i ol = +8.5 ma, v dd = 4.5v so, clkout ? 0.6 v i ol = +2.1 ma, v dd = 4.5v int ?0.6vi ol = +1.6 ma, v dd = 4.5v high-level output voltage v v oh txcan, rxnbf pins v dd ? 0.7 ? v i oh = -3.0 ma, v dd = 4.5v so, clkout v dd ? 0.5 ? v i oh = -400 a, v dd = 4.5v int v dd ? 0.7 ? v i oh = -1.0 ma, v dd = 4.5v input leakage current i li all i/o except osc1 and txnrts pins -1 +1 a cs = reset = v dd , v in = v ss to v dd osc1 pin -5 +5 a c int internal capacitance (all inputs and outputs) ?7pft amb = 25c, f c = 1.0 mhz, v dd = 0v ( note 1 ) i dd operating current ? 10 ma v dd = 5.5v, f osc = 25 mhz, f clk = 1 mhz, so = open i dds standby current (sleep mode) ? 5 a cs, txnrts = v dd , inputs tied to v dd or v ss , -40c to +85c ?8acs, txnrts = v dd , inputs tied to v dd or v ss , -40c to +125c note 1: this parameter is periodically sampled and not 100% tested.
? 2005 microchip technology inc. preliminary ds21801d-page 71 mcp2515 table 13-2: oscillator timing characteristics table 13-3: can interface ac characteristics table 13-4: reset ac characteristics oscillator timing characteristics (note) industrial (i): t amb = -40c to +85c v dd = 2.7v to 5.5v extended (e): t amb = -40c to +125c v dd = 4.5v to 5.5v param. no. sym characteristic min max units conditions f osc clock-in frequency 1 1 40 25 mhz mhz 4.5v to 5.5v 2.7v to 5.5v t osc clock-in period 25 40 1000 1000 ns ns 4.5v to 5.5v 2.7v to 5.5v t duty duty cycle (external clock input) 0.45 0.55 ? t osh /(t osh + t osl ) note: this parameter is periodically sampled and not 100% tested. can interface ac characteristics industrial (i): t amb = -40c to +85c v dd = 2.7v to 5.5v extended (e): t amb = -40c to +125c v dd = 4.5v to 5.5v param. no. sym characteristic min max units conditions t wf wake-up noise filter 100 ? ns reset ac characteristics industrial (i): t amb = -40c to +85c v dd = 2.7v to 5.5v extended (e): t amb = -40c to +125c v dd = 4.5v to 5.5v param. no. sym characteristic min max units conditions trl reset pin low time 2 ? s
mcp2515 ds21801d-page 72 preliminary ? 2005 microchip technology inc. table 13-5: clkout pin ac characteristics figure 13-1: start-of-frame pin ac characteristics clkout pin ac/dc characteristics industrial (i): t amb = -40c to +85c v dd = 2.7v to 5.5v extended (e): t amb = -40c to +125c v dd = 4.5v to 5.5v param. no. sym characteristic min max units conditions t h clkout clkout pin high time 15 ? ns t osc = 40 ns (note 1) t l clkout clkout pin low time 15 ? ns t osc = 40 ns (note 1) t r clkout clkout pin rise time ? 5 ns measured from 0.3 v dd to 0.7 v dd (note 1) t f clkout clkout pin fall time ? 5 ns measured from 0.7 v dd to 0.3 v dd (note 1) t d clkout clockout propagation delay ? 100 ns note 1 15 t h sof start-of-frame high time ? 2 t osc ns note 1 16 t d sof start-of-frame propagation delay ?2t osc + 0.5 t q ns measured from can bit sample point. device is a receiver. cnf1.brp<5:0> = 0 (note 2) note 1: all clkout mode functionality and output frequency is test ed at device frequency limits, however, clkout prescaler is set to divide by one. this parameter is periodically sampled and not 100% tested. 2: design guidance only, not tested. rxcan 16 15 sample point
? 2005 microchip technology inc. preliminary ds21801d-page 73 mcp2515 table 13-6: spi? interface ac characteristics spi? interface ac characteristics industrial (i): t amb = -40c to +85c v dd = 2.7v to 5.5v extended (e): t amb = -40c to +125c v dd = 4.5v to 5.5v param. no. sym characteristic min max units conditions f clk clock frequency ? 10 mhz 1t css cs setup time 50 ? ns 2t csh cs hold time 50 ? ns 3t csd cs disable time 50 ? ns 4t su data setup time 10 ? ns 5t hd data hold time 10 ? ns 6t r clk rise time ? 2 s note 1 7t f clk fall time ? 2 s note 1 8t hi clock high time 45 ? ns 9t lo clock low time 45 ? ns ns 10 t cld clock delay time 50 ? ns 11 t cle clock enable time 50 ? ns 12 t v output valid from clock low ? 45 ns 13 t ho output hold time 0 ? ns 14 t dis output disable time ? 100 ns note 1: this parameter is not 100% tested.
mcp2515 ds21801d-page 74 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 75 mcp2515 14.0 packaging information 14.1 package marking information 18-lead pdip (300 mil) 18-lead soic (300 mil) 20-lead tssop (4.4 mm) xxxxxxxx xxxxxnnn yyww xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxx yywwnnn xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx yywwnnn example: example: example: mcp2515 ist ^ 256 0434 mcp2515 0434256 mcp2515 -i/p^^ 0434256 legend: xx...x customer-specific information y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week ?01?) nnn alphanumeric traceability code pb-free jedec designator for matte tin (sn) * this package is pb-free. the pb-free jedec designator ( ) can be found on the outer packaging for this package. note : in the event the full microchip part number cannot be marked on one line, it will be carried over to the next line, thus limiting the number of available characters for customer-specific information. 3 e 3 e e/so ^^ 3 e 3 e 3 e
mcp2515 ds21801d-page 76 preliminary ? 2005 microchip technology inc. 18-lead plastic dual in-line (p) ? 300 mil (pdip) 15 10 5 15 10 5 mold draft angle bottom 15 10 5 15 10 5 mold draft angle top 10.92 9.40 7.87 .430 .370 .310 eb overall row spacing 0.56 0.46 0.36 .022 .018 .014 b lower lead width 1.78 1.46 1.14 .070 .058 .045 b1 upper lead width 0.38 0.29 0.20 .015 .012 .008 c lead thickness 3.43 3.30 3.18 .135 .130 .125 l tip to seating plane 22.99 22.80 22.61 .905 .898 .890 d overall length 6.60 6.35 6.10 .260 .250 .240 e1 molded package width 8.26 7.94 7.62 .325 .313 .300 e shoulder to shoulder width 0.38 .015 a1 base to seating plane 3.68 3.30 2.92 .145 .130 .115 a2 molded package thickness 4.32 3.94 3.56 .170 .155 .140 a top to seating plane 2.54 .100 p pitch 18 18 n number of pins max nom min max nom min dimension limits millimeters inches* units 1 2 d n e1 c eb e p a2 l b1 b a a1 * controlling parameter notes: dimensions d and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed .010? (0.254mm) per side. jedec equivalent: ms-001 drawing no. c04-007 significant characteristic
? 2005 microchip technology inc. preliminary ds21801d-page 77 mcp2515 18-lead plastic small outline (so) ? wide, 300 mil (soic) foot angle 048048 15 12 0 15 12 0 mold draft angle bottom 15 12 0 15 12 0 mold draft angle top 0.51 0.42 0.36 .020 .017 .014 b lead width 0.30 0.27 0.23 .012 .011 .009 c lead thickness 1.27 0.84 0.41 .050 .033 .016 l foot length 0.74 0.50 0.25 .029 .020 .010 h chamfer distance 11.73 11.53 11.33 .462 .454 .446 d overall length 7.59 7.49 7.39 .299 .295 .291 e1 molded package width 10.67 10.34 10.01 .420 .407 .394 e overall width 0.30 0.20 0.10 .012 .008 .004 a1 standoff 2.39 2.31 2.24 .094 .091 .088 a2 molded package thickness 2.64 2.50 2.36 .104 .099 .093 a overall height 1.27 .050 p pitch 18 18 n number of pins max nom min max nom min dimension limits millimeters inches* units l c h 45 1 2 d p n b e1 e a2 a1 a * controlling parameter notes: dimensions d and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed .010? (0.254mm) per side. jedec equivalent: ms-013 drawing no. c04-051 significant characteristic
mcp2515 ds21801d-page 78 preliminary ? 2005 microchip technology inc. 20-lead plastic thin shrink small outline (st) ? 4.4 mm (tssop) foot angle 048048 10 5 0 10 5 0 mold draft angle bottom 10 5 0 10 5 0 mold draft angle top 0.30 0.25 0.19 .012 .010 .007 b lead width 0.20 0.15 0.09 .008 .006 .004 c lead thickness 0.70 0.60 0.50 .028 .024 .020 l foot length 6.60 6.50 6.40 .260 .256 .252 d molded package length 4.50 4.40 4.30 .177 .173 .169 e1 molded package width 6.50 6.38 6.25 .256 .251 .246 e overall width 0.15 0.10 0.05 .006 .004 .002 a1 standoff 0.95 0.90 0.85 .037 .035 .033 a2 molded package thickness 1.10 .043 a overall height 0.65 .026 p pitch 20 20 n number of pins max nom min max nom min dimension limits millimeters* inches units 1 2 d p n b e1 e l c a2 a1 a * controlling parameter notes: dimensions d and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed .005? (0.127mm) per side. jedec equivalent: mo-153 drawing no. c04-088 significant characteristic
? 2005 microchip technology inc. preliminary ds21801d-page 79 mcp2515 appendix a: revision history revision d (april 2005) the following is the list of modifications: 1. section 8.0. added table 8-1 and table 8-2. added note box following tables. 2. section 11.0, table 11-1. changed address bits in column heading. 3. modified section 14.0 packaging information to reflect pb free device markings. 4. appendix a revision history: rearranged order of importance. revision c (november 2004) the following is the list of modifications: 1. new section 9.0 added. 2. section 12, heading 12.1: added notebox. heading 12.6: changed verbiage within paragraph. 3. added appendix a: revision history. revision b (september 2003) the following is the list of modifications: 1. front page bullet: standby current (typical) (sleep mode) changed from 10 a to 1 a 2. section 8.2 clkout pin: added notebox for maximum frequency on clkout. 3. section 12.0, table 12-1: - changed supply voltage minimum to 2.7v. - internal capacitance: changed v dd condition to 0v. - standby current (sleep mode): split specification into -40c to +85c and -40c to +125c. revision a (may 2003) ? original relase of this document.
mcp2515 ds21801d-page 80 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 81 mcp2515 product identification system to order or obtain information, e. g., on pricing or delivery, refer to the factory or the listed sales office . device mcp2515: can controller w/ spi? interface mcp2515t: can controller w/spi interface (tape and reel) temperature range i= -40 c to +85 c (industrial) e= -40 c to +125 c (extended) package p = plastic dip (300 mil body), 18-lead so = plastic soic (300 mil body), 18-lead st = tssop, (4.4 mm body), 20-lead part no. x /xx package temperature range device examples: a) mcp2515-e/p: extended temperature, 18ld pdip package. b) mcp2515-i/p: industrial temperature, 18ld pdip package. c) mcp2515-e/so: extended temperature, 18ld soic package. d) mcp2515-i/so: industrial temperature, 18ld soic package. e) mcp2515t-i/so: tape and reel, industrial temperature, 18ld soic package. f) mcp2515-i/st: industrial temperature, 20ld tssop package. g) mcp2515t-i/st: tape and reel, industrial temperature, 20ld tssop package. ?
mcp2515 ds21801d-page 82 preliminary ? 2005 microchip technology inc. notes:
? 2005 microchip technology inc. preliminary ds21801d-page 83 information contained in this publication regarding device applications and the like is prov ided only for your convenience and may be superseded by updates. it is your responsibility to ensure that your application m eets with your specifications. microchip makes no representations or war- ranties of any kind whether express or implied, written or oral, statutory or otherwise, related to the information, including but not limited to its condition, quality, performance, merchantability or fitness for purpose . microchip disclaims all liability arising from this information and its use. use of microchip?s products as critical components in life support systems is not authorized except with express written approval by microchip. no licenses are conveyed, implicitly or otherwise, under any microchip intellectual property rights. trademarks the microchip name and logo, the microchip logo, accuron, dspic, k ee l oq , micro id , mplab, pic, picmicro, picstart, pro mate, powersmart, rfpic, and smartshunt are registered trademarks of micr ochip technology incorporated in the u.s.a. and other countries. amplab, filterlab, migratable memory, mxdev, mxlab, picmaster, seeval, smartsensor and the embedded control solutions company are registered trademarks of microchip technology incorporated in the u.s.a. analog-for-the-digital age, app lication maestro, dspicdem, dspicdem.net, dspicworks, ecan, economonitor, fansense, flexrom, fuzzylab, in-circuit serial programming, icsp, icepic, mpasm, mplib, mplink, mpsim, pickit, picdem, picdem.net, piclab, pictail, powercal, powerinfo, powermate, powertool, rflab, rfpicdem, select mode, smart serial, smarttel, total endurance and wiperlock are tr ademarks of microchip technology incorporated in the u.s.a. and other countries. sqtp is a service mark of mi crochip technology incorporated in the u.s.a. all other trademarks mentioned herein are property of their respective companies. ? 2005, microchip technology incorporated, printed in the u.s.a., all rights reserved. printed on recycled paper. note the following details of the code protection feature on microchip devices: ? microchip products meet the specification cont ained in their particular microchip data sheet. ? microchip believes that its family of products is one of the most secure families of its kind on the market today, when used i n the intended manner and under normal conditions. ? there are dishonest and possibly illegal methods used to breach the code protection feature. all of these methods, to our knowledge, require using the microchip produc ts in a manner outside the operating specif ications contained in microchip?s data sheets. most likely, the person doing so is engaged in theft of intellectual property. ? microchip is willing to work with the customer who is concerned about the integrity of their code. ? neither microchip nor any other semiconduc tor manufacturer can guarantee the security of their code. code protection does not mean that we are guaranteeing the product as ?unbreakable.? code protection is constantly evolving. we at microchip are co mmitted to continuously improvin g the code protection features of our products. attempts to break microchip?s code protection feature may be a violation of the digital millennium copyright act. if such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that act. microchip received iso/ts-16949:2002 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in chandler and tempe, arizona and mountain view, california in october 2003. the company?s quality system processes and procedures are for its picmicro ? 8-bit mcus, k ee l oq ? code hopping devices, serial eeproms, microperipherals, nonvolatile memory and analog products. in addition, microchip?s quality system for the design and manufacture of development systems is iso 9001:2000 certified.
ds21801d-page 84 preliminary ? 2005 microchip technology inc. americas corporate office 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7200 fax: 480-792-7277 technical support: http://support.microchip.com web address: www.microchip.com atlanta alpharetta, ga tel: 770-640-0034 fax: 770-640-0307 boston westborough, ma tel: 774-760-0087 fax: 774-760-0088 chicago itasca, il tel: 630-285-0071 fax: 630-285-0075 dallas addison, tx tel: 972-818-7423 fax: 972-818-2924 detroit farmington hills, mi tel: 248-538-2250 fax: 248-538-2260 kokomo kokomo, in tel: 765-864-8360 fax: 765-864-8387 los angeles mission viejo, ca tel: 949-462-9523 fax: 949-462-9608 san jose mountain view, ca tel: 650-215-1444 fax: 650-961-0286 toronto mississauga, ontario, canada tel: 905-673-0699 fax: 905-673-6509 asia/pacific australia - sydney tel: 61-2-9868-6733 fax: 61-2-9868-6755 china - beijing tel: 86-10-8528-2100 fax: 86-10-8528-2104 china - chengdu tel: 86-28-8676-6200 fax: 86-28-8676-6599 china - fuzhou tel: 86-591-8750-3506 fax: 86-591-8750-3521 china - hong kong sar tel: 852-2401-1200 fax: 852-2401-3431 china - shanghai tel: 86-21-5407-5533 fax: 86-21-5407-5066 china - shenyang tel: 86-24-2334-2829 fax: 86-24-2334-2393 china - shenzhen tel: 86-755-8203-2660 fax: 86-755-8203-1760 china - shunde tel: 86-757-2839-5507 fax: 86-757-2839-5571 china - qingdao tel: 86-532-502-7355 fax: 86-532-502-7205 asia/pacific india - bangalore tel: 91-80-2229-0061 fax: 91-80-2229-0062 india - new delhi tel: 91-11-5160-8631 fax: 91-11-5160-8632 japan - kanagawa tel: 81-45-471- 6166 fax: 81-45-471-6122 korea - seoul tel: 82-2-554-7200 fax: 82-2-558-5932 or 82-2-558-5934 singapore tel: 65-6334-8870 fax: 65-6334-8850 taiwan - kaohsiung tel: 886-7-536-4818 fax: 886-7-536-4803 taiwan - taipei tel: 886-2-2500-6610 fax: 886-2-2508-0102 taiwan - hsinchu tel: 886-3-572-9526 fax: 886-3-572-6459 europe austria - weis tel: 43-7242-2244-399 fax: 43-7242-2244-393 denmark - ballerup tel: 45-4450-2828 fax: 45-4485-2829 france - massy tel: 33-1-69-53-63-20 fax: 33-1-69-30-90-79 germany - ismaning tel: 49-89-627-144-0 fax: 49-89-627-144-44 italy - milan tel: 39-0331-742611 fax: 39-0331-466781 netherlands - drunen tel: 31-416-690399 fax: 31-416-690340 england - berkshire tel: 44-118-921-5869 fax: 44-118-921-5820 w orldwide s ales and s ervice 03/01/05


▲Up To Search▲   

 
Price & Availability of MCP2515-IP

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X